Revert incorrect RCL_3 drop: RCL_3 PDK_3.0.2
authorPat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:30:29 +0100
branchRCL_3
changeset 23 cd54903d48da
parent 22 b7fa36b488f8
child 24 ea11b8c1e6a4
Revert incorrect RCL_3 drop: Revision: 201033 Kit: 201035
group/bld.inf
help/data/xhtml.zip
help/group/bld.inf
help/inc/mode.hlp.hrh
help/rom/profilesapplicationhelps_variant.iby
layers.sysdef.xml
profile_plat/group/bld.inf
profile_plat/profiles_settings_view_api/group/bld.inf
profile_plat/profiles_settings_view_api/inc/CProfileToneHandler.h
profile_plat/profiles_settings_view_api/profiles_settings_view_api.metaxml
profile_plat/profiles_settings_view_api/tsrc/group/bld.inf
profilesapplication/Profiles/GSProfilesPlugin/data/10283386.rss
profilesapplication/Profiles/GSProfilesPlugin/data/10283386.xml
profilesapplication/Profiles/GSProfilesPlugin/data/GSProfilesPluginRsc.rss
profilesapplication/Profiles/GSProfilesPlugin/group/GSProfilesPlugin.mmp
profilesapplication/Profiles/GSProfilesPlugin/group/GSProfilesPluginExports.inc
profilesapplication/Profiles/GSProfilesPlugin/group/GSProfilesPluginIcons.mk
profilesapplication/Profiles/GSProfilesPlugin/group/bld.inf
profilesapplication/Profiles/GSProfilesPlugin/inc/GSProfilesPlugin.h
profilesapplication/Profiles/GSProfilesPlugin/loc/GSProfilesPlugin.loc
profilesapplication/Profiles/GSProfilesPlugin/src/GSProfilesPlugin.cpp
profilesapplication/Profiles/GSProfilesPlugin/src/GSProfilesPluginImplementationTable.cpp
profilesapplication/Profiles/Group/Profiles.lnt
profilesapplication/Profiles/Group/ProfilesDebug.h
profilesapplication/Profiles/Group/ProfilesUID.h
profilesapplication/Profiles/Group/bld.inf
profilesapplication/Profiles/ProfileAiwProvider/group/ProfileAiwProvider.mmp
profilesapplication/Profiles/ProfileAiwProvider/group/ProfileAiwProviderExports.inc
profilesapplication/Profiles/ProfileAiwProvider/group/ProfileAiwProviderUid.h
profilesapplication/Profiles/ProfileAiwProvider/group/bld.inf
profilesapplication/Profiles/ProfileAiwProvider/loc/ProfileAiwProvider.loc
profilesapplication/Profiles/ProfileAiwProvider/rss/10281F18.rss
profilesapplication/Profiles/ProfileAiwProvider/rss/ProfileAiwProviderResource.rss
profilesapplication/Profiles/ProfileAiwProvider/src/CPapPopupList.cpp
profilesapplication/Profiles/ProfileAiwProvider/src/CPapPopupList.h
profilesapplication/Profiles/ProfileAiwProvider/src/CProfileAiwProvider.cpp
profilesapplication/Profiles/ProfileAiwProvider/src/CProfileAiwProvider.h
profilesapplication/Profiles/ProfileAiwProvider/src/Dllmain.cpp
profilesapplication/Profiles/ProfileApp/BWINS/PROFILESETTINGSVIEWU.DEF
profilesapplication/Profiles/ProfileApp/EABI/ProfileSettingsViewU.DEF
profilesapplication/Profiles/ProfileApp/SettingsViewInc/CProfileEngineHandler.h
profilesapplication/Profiles/ProfileApp/SettingsViewInc/CProfileIndexHandler.h
profilesapplication/Profiles/ProfileApp/SettingsViewInc/CProfileNaviPaneContainer.h
profilesapplication/Profiles/ProfileApp/SettingsViewInc/CProfileSettingsContainer.h
profilesapplication/Profiles/ProfileApp/SettingsViewInc/CProfileTabHandler.h
profilesapplication/Profiles/ProfileApp/SettingsViewInc/MProfileExternalSettingsHandler.h
profilesapplication/Profiles/ProfileApp/SettingsViewInc/MProfileExternalSettingsObserver.h
profilesapplication/Profiles/ProfileApp/SettingsViewInc/MProfileViewHandler.h
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfile3dSettingItem.cpp
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfile3dSettingItem.h
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfile3dSettingPage.cpp
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfile3dSettingPage.h
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileAlertForSettingItem.cpp
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileAlertForSettingItem.h
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileAlertForSettingPage.cpp
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileAlertForSettingPage.h
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileEngineHandler.cpp
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileFeedbackSettingItem.cpp
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileFeedbackSettingItem.h
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileFeedbackSettingPage.cpp
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileFeedbackSettingPage.h
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileFileListSettingItem.cpp
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileFileListSettingItem.h
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileIndexHandler.cpp
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileKeypadVolumeSettingItem.cpp
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileKeypadVolumeSettingItem.h
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileKeypadVolumeSettingPage.cpp
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileKeypadVolumeSettingPage.h
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileNameSettingItem.cpp
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileNameSettingItem.h
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileNameSettingPage.cpp
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileNameSettingPage.h
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileNaviPaneContainer.cpp
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfilePlayingVolumeSettingItem.cpp
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfilePlayingVolumeSettingItem.h
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfilePlayingVolumeSettingPage.cpp
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfilePlayingVolumeSettingPage.h
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileSettingsContainer.cpp
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileStruct.cpp
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileStruct.h
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileStructDrmEmpty.cpp
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileStructDrmFull.cpp
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileTabHandler.cpp
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileToneHandler.cpp
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileToneHandlerDrmEmpty.cpp
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileToneHandlerDrmFull.cpp
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileVibraSettingItem.cpp
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileVibraSettingItem.h
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileVibraSettingPage.cpp
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileVibraSettingPage.h
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/ProfileMmfInfoUtility.cpp
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/ProfileMmfInfoUtility.h
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/ProfilePanics.h
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/ProfileSettingsView.hrh
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/ProfileSettingsView.rss
profilesapplication/Profiles/ProfileApp/SettingsViewSrc/ProfileSettingsViewCommon.rss
profilesapplication/Profiles/ProfileApp/UIsrc/CProfileAppUi.cpp
profilesapplication/Profiles/ProfileApp/UIsrc/CProfileAppUi.h
profilesapplication/Profiles/ProfileApp/UIsrc/CProfileApplication.cpp
profilesapplication/Profiles/ProfileApp/UIsrc/CProfileApplication.h
profilesapplication/Profiles/ProfileApp/UIsrc/CProfileApplication_SEC_APPARC.cpp
profilesapplication/Profiles/ProfileApp/UIsrc/CProfileDocument.cpp
profilesapplication/Profiles/ProfileApp/UIsrc/CProfileDocument.h
profilesapplication/Profiles/ProfileApp/UIsrc/CProfileMainContainer.cpp
profilesapplication/Profiles/ProfileApp/UIsrc/CProfileMainContainer.h
profilesapplication/Profiles/ProfileApp/UIsrc/CProfileMainView.cpp
profilesapplication/Profiles/ProfileApp/UIsrc/CProfileMainView.h
profilesapplication/Profiles/ProfileApp/UIsrc/CProfileSettingsView.cpp
profilesapplication/Profiles/ProfileApp/UIsrc/CProfileSettingsView.h
profilesapplication/Profiles/ProfileApp/UIsrc/MProfileRectUpdater.h
profilesapplication/Profiles/ProfileApp/UIsrc/ProfileApp.hrh
profilesapplication/Profiles/ProfileApp/UIsrc/ProfileApp.rss
profilesapplication/Profiles/ProfileApp/group/ProfileApp.lnt
profilesapplication/Profiles/ProfileApp/group/ProfileApp.mmp
profilesapplication/Profiles/ProfileApp/group/ProfileAppExports.inc
profilesapplication/Profiles/ProfileApp/group/ProfileApp_reg.rss
profilesapplication/Profiles/ProfileApp/group/ProfileSettingsView.mmp
profilesapplication/Profiles/ProfileApp/group/ProjLint.bat
profilesapplication/Profiles/ProfileApp/group/bld.inf
profilesapplication/Profiles/ProfileApp/group/icons_aif_bitmaps_dc.mk
profilesapplication/Profiles/ProfileApp/group/icons_aif_scalable_dc.mk
profilesapplication/Profiles/ProfileApp/loc/ProfileApp.loc
profilesapplication/Profiles/ProfileApp/tsrc/public/ProfileStif/Bmarm/ProfileStifU.DEF
profilesapplication/Profiles/ProfileApp/tsrc/public/ProfileStif/Bwins/ProfileStifU.DEF
profilesapplication/Profiles/ProfileApp/tsrc/public/ProfileStif/EABI/ProfileStifU.def
profilesapplication/Profiles/ProfileApp/tsrc/public/ProfileStif/conf/tcProfile.cfg
profilesapplication/Profiles/ProfileApp/tsrc/public/ProfileStif/conf/ui_Profile.cfg
profilesapplication/Profiles/ProfileApp/tsrc/public/ProfileStif/group/ProfileStif.mmp
profilesapplication/Profiles/ProfileApp/tsrc/public/ProfileStif/group/ProfileStif.pkg
profilesapplication/Profiles/ProfileApp/tsrc/public/ProfileStif/group/ProfileStif_DoxyFile.txt
profilesapplication/Profiles/ProfileApp/tsrc/public/ProfileStif/group/TestFramework.ini
profilesapplication/Profiles/ProfileApp/tsrc/public/ProfileStif/group/bld.inf
profilesapplication/Profiles/ProfileApp/tsrc/public/ProfileStif/group/profile_c.bat
profilesapplication/Profiles/ProfileApp/tsrc/public/ProfileStif/group/profile_z.bat
profilesapplication/Profiles/ProfileApp/tsrc/public/ProfileStif/inc/ProfileStif.h
profilesapplication/Profiles/ProfileApp/tsrc/public/ProfileStif/src/ProfileStif.cpp
profilesapplication/Profiles/ProfileApp/tsrc/public/ProfileStif/src/ProfileStifBlocks.cpp
profilesapplication/Profiles/ProfileApp/tsrc/public/basic/bwins/T_ProfileSettingsViewu.def
profilesapplication/Profiles/ProfileApp/tsrc/public/basic/eabi/T_ProfileSettingsViewu.def
profilesapplication/Profiles/ProfileApp/tsrc/public/basic/group/T_ProfileSettingsView.mmp
profilesapplication/Profiles/ProfileApp/tsrc/public/basic/group/T_ProfileSettingsView.pkg
profilesapplication/Profiles/ProfileApp/tsrc/public/basic/group/bld.inf
profilesapplication/Profiles/ProfileApp/tsrc/public/basic/inc/T_CProfileToneHandler.h
profilesapplication/Profiles/ProfileApp/tsrc/public/basic/rom/ProfileApp_ats3.iby
profilesapplication/Profiles/ProfileApp/tsrc/public/basic/src/DllMain.cpp
profilesapplication/Profiles/ProfileApp/tsrc/public/basic/src/T_CProfileToneHandler.cpp
profilesapplication/Profiles/ProfilesGSTonesPlugin/data/1020729B.rss
profilesapplication/Profiles/ProfilesGSTonesPlugin/data/ProfilesGSTonesPluginRsc.rss
profilesapplication/Profiles/ProfilesGSTonesPlugin/group/ProfilesGSTonesPlugin.mmp
profilesapplication/Profiles/ProfilesGSTonesPlugin/group/bld.inf
profilesapplication/Profiles/ProfilesGSTonesPlugin/inc/ProfilesGSTonesPlugin.h
profilesapplication/Profiles/ProfilesGSTonesPlugin/inc/ProfilesGSTonesPlugin.hrh
profilesapplication/Profiles/ProfilesGSTonesPlugin/loc/ProfilesGsTonesPlugin.loc
profilesapplication/Profiles/ProfilesGSTonesPlugin/src/CProfilesGSTonesPluginFileListSettingItem.cpp
profilesapplication/Profiles/ProfilesGSTonesPlugin/src/CProfilesGSTonesPluginFileListSettingItem.h
profilesapplication/Profiles/ProfilesGSTonesPlugin/src/CProfilesGSTonesPluginSettingsHandler.cpp
profilesapplication/Profiles/ProfilesGSTonesPlugin/src/CProfilesGSTonesPluginSettingsHandler.h
profilesapplication/Profiles/ProfilesGSTonesPlugin/src/CProfilesGSTonesPluginSettingsHandlerDrmEmpty.cpp
profilesapplication/Profiles/ProfilesGSTonesPlugin/src/CProfilesGSTonesPluginSettingsHandlerDrmFull.cpp
profilesapplication/Profiles/ProfilesGSTonesPlugin/src/CProfilesGSTonesViewFeatures.cpp
profilesapplication/Profiles/ProfilesGSTonesPlugin/src/CProfilesGSTonesViewFeatures.h
profilesapplication/Profiles/ProfilesGSTonesPlugin/src/CProfilesGSTonesViewSettings.cpp
profilesapplication/Profiles/ProfilesGSTonesPlugin/src/CProfilesGSTonesViewSettings.h
profilesapplication/Profiles/ProfilesGSTonesPlugin/src/MProfilesGSTonesPluginItemDataInterface.h
profilesapplication/Profiles/ProfilesGSTonesPlugin/src/ProfilesGSTonesPlugin.cpp
profilesapplication/Profiles/ProfilesGSTonesPlugin/src/ProfilesGSTonesPluginImplementationTable.cpp
profilesapplication/Profiles/rom/Profile.iby
profilesapplication/Profiles/rom/ProfileResources.iby
profilesapplication/Profiles/tsrc/public/basic/group/bld.inf
profilesapplication/Profiles/tsrc/public/basic/rom/Profiles_ats3.iby
profilesapplication/group/bld.inf
profilesapplication/tsrc/public/basic/group/bld.inf
profilesapplication/tsrc/public/basic/rom/ProfilesApplication_ats3.iby
profilesapplication/tsrc/public/basic/test.xml
sysdef_1_4_0.dtd
tsrc/group/bld.inf
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/group/bld.inf	Wed Sep 01 12:30:29 2010 +0100
@@ -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 Profile.
+*
+*/
+
+// Application layer
+// profile ADO
+
+//Components:
+
+//profile
+#include "../profilesapplication/group/bld.inf"
+
+//profile_plat
+#include "../profile_plat/group/bld.inf"
+
+#include "../help/group/bld.inf"
Binary file help/data/xhtml.zip has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/help/group/bld.inf	Wed Sep 01 12:30:29 2010 +0100
@@ -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/mode.hlp.hrh	MW_LAYER_PLATFORM_EXPORT_PATH(csxhelp/mode.hlp.hrh)
+../rom/profilesapplicationhelps_variant.iby		CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(profilesapplicationhelps_variant.iby)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/help/inc/mode.hlp.hrh	Wed Sep 01 12:30:29 2010 +0100
@@ -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:
+*
+*/
+	
+//
+// mode.hlp.hrh generated by CSXHelp Utilities.
+//           
+
+#ifndef __MODE_HLP_HRH__
+#define __MODE_HLP_HRH__
+
+_LIT(KMODE_HLP_PERSONALISE, "MODE_HLP_PERSONALISE"); // 
+_LIT(KSET_HLP_PERSONAL_TONES, "SET_HLP_PERSONAL_TONES"); // 
+_LIT(KMODE_HLP_PROFILES_LIST, "MODE_HLP_PROFILES_LIST"); // 
+
+#endif 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/help/rom/profilesapplicationhelps_variant.iby	Wed Sep 01 12:30:29 2010 +0100
@@ -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: 
+*
+*/
+#ifndef __PROFILESAPPLICATIONHELPS_VARIANT_IBY__
+#define __PROFILESAPPLICATIONHELPS_VARIANT_IBY__
+
+#if defined(FF_S60_HELPS_IN_USE)
+    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x100058F8\contents.zip, RESOURCE_FILES_DIR\xhtml\%02d\0x100058F8\contents.zip)
+    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x100058F8\index.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x100058F8\index.xml)
+    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x100058F8\keywords.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x100058F8\keywords.xml)
+    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x100058F8\meta.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x100058F8\meta.xml)
+#endif
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/layers.sysdef.xml	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE SystemDefinition SYSTEM "sysdef_1_4_0.dtd" [
+  <!ENTITY layer_real_source_path "sf/app/profile" >
+]>
+
+<SystemDefinition name="profile" schema="1.4.0">
+  <systemModel>
+    <layer name="app_layer">
+      <module name="profile">
+        <unit name="profile" unitID="presdo.profile" bldFile="&layer_real_source_path;/group" mrp="" />
+      </module>
+    </layer>
+    <layer name="api_test_layer">
+      <module name="profile_test">
+        <!--<unit unitID="presdo.profile_test" mrp="" bldFile="&layer_real_source_path;/tsrc/group" name="profile_test" />-->
+        <unit unitID="presdo.profile_test" mrp="" bldFile="&layer_real_source_path;/profilesapplication/Profiles/ProfileApp/tsrc/public/basic/group" name="profile_test" />
+      </module>
+    </layer>      
+  </systemModel>
+</SystemDefinition>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profile_plat/group/bld.inf	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,20 @@
+/*
+* 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:  Includes all the Domain API specific bld.inf files, which 
+*                export files.
+*
+*/
+
+
+#include "../profiles_settings_view_api/group/bld.inf"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profile_plat/profiles_settings_view_api/group/bld.inf	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  File that exports the files belonging to 
+:                Profiles Settings View API
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/CProfileToneHandler.h     APP_LAYER_PLATFORM_EXPORT_PATH(cprofiletonehandler.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profile_plat/profiles_settings_view_api/inc/CProfileToneHandler.h	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,413 @@
+/*
+* 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 interface to be used by S60 applications for
+*                setting ringing and alert tones for different profiles.
+*                Registers DRM protected tones as automated content
+*                and removes old content from automated content list.
+*                Shows a content activation query if necessary.
+*
+*/
+
+
+
+#ifndef CPROFILETONEHANDLER_H
+#define CPROFILETONEHANDLER_H
+
+//  INCLUDES
+#include <f32file.h> // CBase, RFs
+#include <MSSSettingsObserver.h> // MSSSettingsObserver, RSSSettings
+#include <apmstd.h> // KMaxDataTypeLength
+#include <data_caging_path_literals.hrh>
+
+// DATA TYPES
+
+/**
+*  Enumerations for different tone settings in Profiles.
+*  Should there become a need e.g. for separately place line 1 and line 2
+*  ringing tones, we just add them to these enumerations.
+*/
+enum TProfileTones
+    {
+    EProfileRingingToneSetting              = 1,
+    EProfileVideoCallToneSetting            = 2,
+    EProfileMessageAlertToneSetting         = 3,
+    EProfileInstantMessageAlertToneSetting  = 4,
+    EProfileEmailAlertToneSetting           = 5
+    };
+
+// FORWARD DECLARATIONS
+class DRMCommon;
+class CDRMHelper;
+class MProfileExtended;
+class MProfileEngineExtended;
+class MProfilesLocalFeatures;
+
+// CLASS DECLARATION
+
+/**
+*  A helper interface to be used by S60 applications for
+*  setting ringing and alert tones for different profiles.
+*  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 ProfileSettingsView.lib
+*  @since Series 60 2.6
+*/
+class CProfileToneHandler : public CBase, public MSSSettingsObserver
+    {
+    public:  // Constructors and destructor
+
+        // Two-phased constructors.
+        IMPORT_C static CProfileToneHandler* NewL();
+        IMPORT_C static CProfileToneHandler* NewLC();
+
+        // Destructor.
+        ~CProfileToneHandler();
+
+    public: // New functions
+
+        /**
+         * Sets the ringing tone of the current active profile.
+         * If the file does not exist, leaves with KErrNotFound.
+         * If the file is of an unsupported type, leaves with KErrNotSupported.
+         * If the file is an unprotected MP3/AAC in user data area
+         * and if those are not allowed as ringing or alert tones,
+         * leaves with KErrPermissionDenied.
+         * If the file is a WMA file in user data area and those are not
+         * allowed, leaves with KErrArgument.
+         * If the active profile is not allowed to be changed
+         * (e.g. Drive-profile) leaves with KErrAccessDenied.
+         * If Alternate Line Service is enabled, finds out the line in use
+         * and sets the ringing tone for that line respectively.
+         * @since 2.6
+         * @param aFileName Full path and filename of the tone to be used
+         *        as the new ringing tone. An empty descriptor
+         *        will be replaced with "No_Sound.wav".
+         * @return KErrNone if successful,
+         *         KErrCancel if user answers No to a DRM activation query.
+         *         (See DRMHelper::SetAutomatedPassive)
+         *         KErrGeneral if DRM rights are insufficient.
+		 *		   KErrArgument if the file is DRM protected
+		 *		   audio/mp4 and those are not allowed as ringingtones.
+         */
+        IMPORT_C TInt SetActiveProfileRingingToneL( const TDesC& aFileName );
+
+        /**
+         * Sets a ringing or alert tone for a profile.
+         * If the file does not exist, leaves with KErrNotFound.
+         * If the file is of an unsupported type, leaves with KErrNotSupported.
+         * If the file is an unprotected MP3/AAC in user data area
+         * and if those are not allowed as ringing or alert tones,
+         * leaves with KErrPermissionDenied.
+         * If the file is a WMA file in user data area and those are not
+         * allowed, leaves with KErrArgument.
+         * If the file is not allowed to be changed
+         * leaves with KErrAccessDenied.
+         * If the selected profile is not allowed to be changed
+         * (e.g. Drive-profile) leaves with KErrAccessDenied.
+         * In case of a ringing tone, if Alternate Line Service is enabled,
+         * finds out the line in use and sets the ringing tone for that
+         * line respectively.
+         * @since 2.6
+         * @param aProfileId The ID of the profile (NOT an index).
+         * @param aToneSetting Identifies the tone which is updated.
+         * @param aFileName Full path and filename of the tone to be used
+         *        as the new ringing or alert tone. An empty descriptor
+         *        will be replaced with "No_Sound.wav".
+         * @return Returns KErrNone if successful,
+         *         KErrCancel if user answers No to a DRM activation query.
+         *         (See DRMHelper::SetAutomatedPassive)
+         *         KErrGeneral if DRM rights are insufficient.
+		 *		   KErrArgument if the file is DRM protected
+		 *		   audio/mp4 and those are not allowed as ringingtones.
+         */
+        IMPORT_C TInt SetProfileToneL( TInt aProfileId,
+            TProfileTones aToneSetting, const TDesC& aFileName );
+
+        /**
+         * Sets a ringing or alert tone for a profile and not check the file.
+         * This function only can be used when user set a ringing or alert tone
+         * for some profiles and avoid to repeat check the file.
+         * Notice: the SetProfileToneL should be executed before this function, because
+         * SetProfileToneL will check the file.
+         * leaves with KErrPermissionDenied.
+         * If the file is a WMA file in user data area and those are not
+         * allowed, leaves with KErrArgument.
+         * If the file is not allowed to be changed
+         * leaves with KErrAccessDenied.
+         * If the selected profile is not allowed to be changed
+         * (e.g. Drive-profile) leaves with KErrAccessDenied.
+         * In case of a ringing tone, if Alternate Line Service is enabled,
+         * finds out the line in use and sets the ringing tone for that
+         * line respectively.
+         * @param aProfileId The ID of the profile (NOT an index).
+         * @param aToneSetting Identifies the tone which is updated.
+         * @param aFileName Full path and filename of the tone to be used
+         *        as the new ringing or alert tone. An empty descriptor
+         *        will be replaced with "No_Sound.wav".
+         * @return Returns KErrNone this function didn't check the file, so return KErrNone.
+         */
+        IMPORT_C TInt SetProfileToneNotCheckL( TInt aProfileId,
+            TProfileTones aToneSetting, const TDesC& aFileName );
+
+        /**
+         * Sets a ringing or alert tone for all profiles.
+         * If the file does not exist, leaves with KErrNotFound.
+         * If the file is of an unsupported type, leaves with KErrNotSupported.
+         * If the file is an unprotected MP3/AAC in user data area
+         * and if those are not allowed as ringing or alert tones,
+         * leaves with KErrPermissionDenied.
+         * If the file is a WMA file in user data area and those are not
+         * allowed, leaves with KErrArgument.
+         * If the file is not allowed to be changed
+         * (e.g. Drive-profile) method ignores profile changes
+         * and selects next profile.
+         * In case of a ringing tone, if Alternate Line Service is enabled,
+         * finds out the line in use and sets the ringing tone for that
+         * line respectively.
+         * Does not affect on user created profiles except if the active profile
+         * is user created of which the ringing or alert tone is also changed.
+         * @since 2.6
+         * @param aToneSetting Identifies the tone which is updated.
+         * @param aFileName Full path and filename of the tone to be used
+         *        as the new ringing or alert tone. An empty descriptor
+         *        will be replaced with "No_Sound.wav".
+         * @return Returns KErrNone if successful,
+         *         KErrCancel if user answers No to a DRM activation query.
+         *         (See DRMHelper::SetAutomatedPassive)
+         *         KErrGeneral if DRM rights are insufficient.
+		 *		   KErrArgument if the file is DRM protected
+		 *		   audio/mp4 and those are not allowed as ringingtones.
+         */
+        IMPORT_C TInt SetToneForAllProfilesL( TProfileTones aToneSetting,
+            const TDesC& aFileName );
+
+    public:     // From base classes
+
+        /**
+         * From MSSSettings
+         */
+        void PhoneSettingChanged( TSSSettingsSetting aSetting, TInt aNewValue );
+
+    protected:  // New functions
+
+        /**
+         * Stores the settings to Profiles Engine and adds the file to automated
+         * content list and removes the old file from automated content list.
+         * Do not call until the file is checked using CheckFileL.
+         * @param aProfileId The ID of the profile (NOT an index).
+         * @param aToneSetting Identifies the tone which is updated.
+         * @param aFileName Full path and filename of the tone to be used
+         *                  as the new ringing or alert tone.
+         */
+        void DoSetProfileToneL( TInt aProfileId,
+            TProfileTones aToneSetting, const TDesC& aFileName );
+
+        /**
+         * Sets the tone to an MProfileExtended instance.
+         * @param aProfile The MProfileExtended instance.
+         * @param aToneSetting Identifies the tone which is updated.
+         * @param aFileName The tone file name.
+         */
+        void SetToneL( MProfileExtended& aProfile,
+            TProfileTones aToneSetting, const TDesC& aFileName );
+
+        /**
+         * Reads a tone setting from an MProfileExtended instance.
+         * @param aProfile The MProfileExtended instance.
+         * @param aToneSetting Identifies the tone which is read.
+         * @return Returns the tone file name.
+         */
+        const TDesC& ReadToneL( const MProfileExtended& aProfile,
+            TProfileTones aToneSetting ) const;
+
+        /**
+         * Checks that the given tone file exists and that it is
+         * a legal file to be used as a ringing or alert tone.
+         * @since 2.6
+         * @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,
+         *         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.
+         */
+        TInt CheckFileL( const TDesC& aFileName );
+
+        /**
+         * Checks if a DRM protected file can be used as a ringing or alert tone.
+         * @since 2.6
+         * @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.
+         * @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.
+         * @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.
+         * @param aToneSetting The type of tone (e.g. ringing tone, SMS tone) to
+         *        be registered as automated content.
+         * @param aFileName File to be registered as automated content.
+         * @return KErrNone or a system-wide error code.
+         */
+        TInt SetAutomated( TProfileTones aToneSetting, const TDesC& aFileName );
+
+        /**
+         * Removes a file from automated content list.
+         * Errors are omitted. Does nothing if DRM is not supported.
+         * @param aFileName File to be removed from automated content list.
+         */
+        void RemoveAutomated( const TDesC& aFileName );
+
+        /**
+         * Returns data type of a file.
+         * @param aFileName Full path and filename.
+         * @return Returns the data type of the file.
+         */
+        TBuf<KMaxDataTypeLength> DataTypeL( const TDesC& aFileName ) const;
+
+        /**
+         * Returns whether a file is protected content or not.
+         * Returns always EFalse if DRM is not supported.
+         * @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.
+         * @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.
+         * @param aResourceId Resource ID to a TBUF resource.
+         */
+        void ShowErrorNoteL( TInt aResourceId ) 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;
+
+        /**
+         * Checks the result of CheckFileL() and leaves if needed. Also checks
+         * if the file is protected and can be set as automated content.
+         * @param aResult result of the CheckFileL() call made before this.
+         * @param aFileName the name of the file to be checked for protection
+         * and if it is settable as automated content.
+         * @return KErrNone, if ok, otherwise a system-wide error code.
+         */
+        TInt CheckResultAndProtectionL( TInt aResult,
+                                        const TDesC& aFileName );
+		/**
+         * Checks ringing tone file size.
+         * @param aFile         file to check.
+         * @param aSizeLimitKB  maximum allowed file size in KB.
+         * @return KErrNone, if ok.
+         *         KErrTooBig, if configurable file size limit exceeded.
+         */
+        TInt CheckToneFileSizeL( const TDesC& aFile, TInt aSizeLimitKB );
+
+		/**
+         * Reads maximimum ringing tone file size in KB from cenrep.
+         */
+        void GetMaxToneFileSizeL();
+
+		/**
+         * Displays error note about exceeded tone file size.
+		 * @param aSizeLimitKB  file size limit.
+		 */
+        void ShowSizeErrorNoteL( TInt aSizeLimitKB );
+
+    private:
+
+        /// Default constructor
+        CProfileToneHandler();
+
+        /// 2nd phase constructor
+        void ConstructL();
+
+        /// Constructor for the DRM objects
+        void DrmConstructL();
+
+        /// Destructor for the DRM objects
+        void ReleaseDrm();
+
+		/// Functions related to WMDRM protection check
+		TBool	IsFileWMDRMProtectedL( const TDesC& aFileName );
+
+        /// Called by SetAutomated
+        TInt SetAutomatedL( TProfileTones aToneSetting, const TDesC& aFileName );
+
+    private:    // Data
+
+        /// Owns: DRM Helper client.
+        CDRMHelper* iDrmHelper;
+
+        /// Owns: DRM Common client
+        DRMCommon* iDrmCommon;
+
+        /// Owns: Profile Engine Extended interface.
+        MProfileEngineExtended* iProfileEngine;
+
+        /// Owns: Profiles local features.
+        MProfilesLocalFeatures* iProfilesFeatures;
+
+        /// Supplementary services client for reading Alternate Line Service.
+        RSSSettings iSSSettings;
+
+        /// File Server client.
+        RFs iFs;
+
+        /// Alternate Line Setting value.
+        TInt iAlternateLineSetting;
+    
+        /// Maximum allowed tone file size in kilo bytes.
+        TInt iMaxSizeKB;
+    
+    };
+
+#endif      // CPROFILETONEHANDLER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profile_plat/profiles_settings_view_api/profiles_settings_view_api.metaxml	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,18 @@
+<?xml version="1.0" ?>
+<api id="a8d7604ba9929f05efcfc04175b05882" dataversion="2.0">
+  <name>Profiles Settings View API</name>
+  <description>API which exports a view for personalising profile settings.</description>
+  <type>c++</type>
+  <collection>profilesapplication</collection>
+  <libs>
+    <lib name="ProfileSettingsView.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/profile_plat/profiles_settings_view_api/tsrc/group/bld.inf	Wed Sep 01 12:30:29 2010 +0100
@@ -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 Settings View API test cases.
+*
+*/
+
+////////////////////////////////////////////////////////////
+// bld.inf
+// Part of EUnit library test
+
+#include "../../../../profilesapplication/Profiles/ProfileApp/tsrc/public/basic/group/bld.inf"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/GSProfilesPlugin/data/10283386.rss	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,62 @@
+/*
+* 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 GSConfigPlugin.
+*
+*/
+
+#include <registryinfo.rh>
+
+RESOURCE REGISTRY_INFO theInfo
+	{
+	dll_uid     = 0x10283386;  // dll UID
+	interfaces  =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid   = 0x10207236;  // common UID for all GS plugins
+			implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid  = 0x10283387;  // dll UID + 1
+					version_no          = 1;
+					display_name        = "Profiles Plugin";
+					default_data        = "0x1020723B"; // Parent UID
+                                        //default_data        = "0x10207239"; // Parent UID
+					opaque_data         = "5"; // Order number
+					}
+				};
+			},
+
+                INTERFACE_INFO
+                    {
+                    // UID of interface that is implemented
+                    interface_uid = 0x2000B189;  // from psmpluginbase.h
+                    implementations = 
+                        {
+                        IMPLEMENTATION_INFO
+                            {
+                            implementation_uid = 0x10283388;  // dll UID + 2
+                            //implementation_uid = 0x10200FE1;
+                            version_no         = 1;
+                            //display_name       = "PSMPluginStub1";
+                            display_name       = "Profiles plugin";
+                            default_data       = "";
+                            opaque_data        = "";
+                            }
+                        };
+                    }
+		};
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/GSProfilesPlugin/data/10283386.xml	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,14 @@
+<PowerSaveModeConfig>
+	<Setting mode="1"><!-- PSM mode in multilevel power save mode -->
+		<SetItem key="1" type="0" value="0"></SetItem>  <!-- vibra -->
+		<SetItem key="2" type="0" value="0"></SetItem>  <!-- keypad volume -->
+		<SetItem key="3" type="0" value="0"></SetItem>  <!-- tactile feedback -->
+		<SetItem key="4" type="0" value="0"></SetItem>  <!-- audio feedback -->
+	</Setting>
+	<Setting mode="2"><!-- PSM mode in multilevel power save mode, not supported yet -->
+		<SetItem key="1" type="0" value="0"></SetItem>
+		<SetItem key="2" type="0" value="1"></SetItem>
+		<SetItem key="3" type="0" value="1"></SetItem>
+		<SetItem key="4" type="0" value="1"></SetItem>
+	</Setting>
+</PowerSaveModeConfig>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/GSProfilesPlugin/data/GSProfilesPluginRsc.rss	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  Resource file for GSProfilesPlugin.
+*
+*/
+
+
+//  RESOURCE IDENTIFIER
+NAME        GSPR // 4 letter ID
+
+// INCLUDES
+
+
+#include    <data_caging_paths_strings.hrh>
+#include    <gsprofilesplugin.loc>
+
+
+#include    <uikon.rh>
+
+// CONSTANTS
+
+//  RESOURCE DEFINITIONS
+
+//----------------------------------------------------
+//
+//
+//    Needed or loading the resource fails!
+//
+//----------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+//----------------------------------------------------
+//
+//    r_gs_config_plugin_caption
+//    Configuration Contexts Plugin caption.
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_gs_profiles_plugin_caption
+    {
+    // from GSProfilesPlugin.loc
+    buf = qtn_cp_folder_profiles;
+    }
+
+
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/GSProfilesPlugin/group/GSProfilesPlugin.mmp	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  Project specification file for GSProfilesPlugin.
+*
+*/
+
+
+#include <data_caging_paths.hrh>    //this is needed for RESOURCE_FILES_DIR
+#include <platform_paths.hrh>
+
+CAPABILITY          CAP_ECOM_PLUGIN
+TARGET              gsprofilesplugin.dll
+TARGETTYPE          PLUGIN
+UID                 0x10009D8D 0x10283386  //  dll uid is 0x10283386
+VENDORID            VID_DEFAULT
+
+SOURCEPATH          ../src
+SOURCE              GSProfilesPlugin.cpp
+SOURCE              GSProfilesPluginImplementationTable.cpp
+
+USERINCLUDE         ../data
+USERINCLUDE         ../inc
+
+SYSTEMINCLUDE       .
+SYSTEMINCLUDE       /epoc32/include/cshelp
+SYSTEMINCLUDE       /epoc32/include/ecom
+
+// Default system include paths for application layer modules.
+APP_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH          ../data
+
+//ECOM resource definition
+START RESOURCE      10283386.rss
+TARGET              gsprofilesplugin.rsc
+TARGETPATH          ECOM_RESOURCE_DIR
+END                 //  ECOM resource definition
+
+//OperatorLogo resources
+START RESOURCE      GSProfilesPluginRsc.rss
+HEADER
+TARGETPATH          RESOURCE_FILES_DIR
+LANGUAGE_IDS
+END // OperatorLogo resources
+
+
+LIBRARY             apparc.lib
+LIBRARY             avkon.lib
+LIBRARY             bafl.lib
+LIBRARY             commonengine.lib // RConeResourceLoader
+LIBRARY             cone.lib
+LIBRARY             ecom.lib
+LIBRARY             efsrv.lib
+LIBRARY             egul.lib
+LIBRARY             eikcoctl.lib
+LIBRARY             eikcore.lib
+LIBRARY             euser.lib
+LIBRARY             featmgr.lib
+LIBRARY             gsecomplugin.lib
+LIBRARY             gsframework.lib // Base classes
+LIBRARY             ws32.lib
+LIBRARY             aknskins.lib // AknsUtils.h
+LIBRARY             apgrfx.lib // RApaLsSession
+LIBRARY             psmclient.lib
+LIBRARY             centralrepository.lib
+LIBRARY             profileengine.lib // Profile engine wrapper api
+LIBRARY             profileeng.lib // Profile Engine
+
+
+DEBUGLIBRARY flogger.lib
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/GSProfilesPlugin/group/GSProfilesPluginExports.inc	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,32 @@
+/*
+* ==============================================================================
+*  Name        : GSProfilesPluginExports.inc
+*  Part of     : GSProfilesPlugin
+*  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 GSPROFILESPLUGINEXPORTS_INC
+#define GSPROFILESPLUGINEXPORTS_INC
+
+../loc/GSProfilesPlugin.loc    APP_LAYER_LOC_EXPORT_PATH(gsprofilesplugin.loc)
+
+// Export PSM config file
+../data/10283386.xml z:/private/2000b187/10283386.xml
+#endif      // GSPROFILESPLUGINEXPORTS_INC
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/GSProfilesPlugin/group/GSProfilesPluginIcons.mk	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,71 @@
+#
+# 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 for GSConfigPlugin
+#
+
+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)\gsprofilesplugin.mif
+HEADERFILENAME=$(HEADERDIR)\gsprofilesplugin.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_prop_cp_perso_prof.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/profilesapplication/Profiles/GSProfilesPlugin/group/bld.inf	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,41 @@
+/*
+* 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 GSConfigPlugin.
+*
+*/
+
+// To get the APP_LAYER_LOC_EXPORT_PATH-definition
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+#include "GSProfilesPluginExports.inc"
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE gsprofilesplugin.mif
+  OPTION HEADERFILE gsprofilesplugin.mbg
+  OPTION SOURCES -c8,8 qgn_prop_cp_perso_prof
+END
+
+
+PRJ_MMPFILES
+//gnumakefile GSProfilesPluginIcons.mk
+GSProfilesPlugin.mmp
+
+PRJ_TESTMMPFILES
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/GSProfilesPlugin/inc/GSProfilesPlugin.h	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,251 @@
+/*
+* 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:  GSProfilesPlugin implementation.
+*
+*/
+
+#ifndef GSPROFILESPLUGIN_H
+#define GSPROFILESPLUGIN_H
+
+// User includes
+
+#include <psmpluginbase.h>  // power save management plugin base
+
+
+// System includes
+#include <gsplugininterface.h>
+#include <ConeResLoader.h>
+#include <AknServerApp.h>
+
+// Classes referenced
+class CAknNullService;
+class CRepository;
+class CApaDocument;
+// Constants
+const TUid KGSProfilesPluginUID       = { 0x10283386 };  // dll uid
+const TUid KGSProfilesPluginImplUID   = { 0x10283387 };  // dll impl uid
+const TUid KGsProfilesAppUid          = { 0x100058F8 };  // from ProfileApp.mmp
+
+_LIT( KGSProfilesApp,    "z:\\sys\\bin\\ProfileApp.exe" );
+_LIT( KGSProfilesPluginResourceFileName, "z:GSProfilesPluginRsc.rsc" );
+_LIT( KGSProfilesPluginIconDirAndName, "z:GSProfilesPlugin.mbm"); // Use KDC_BITMAP_DIR
+
+
+enum TPsmPluginKeys
+    {
+    EPsmPluginKeyVibra = 1,
+    EPsmPluginKeyKbdVolume = 2,
+    EPsmPluginTactileFeedback = 3,
+    EPsmPluginAudioFeedback = 4
+    };
+
+
+// CLASS DECLARATION
+
+//For embedding CC in CS
+class TAppInfo
+    {
+    public:
+        TAppInfo( TUid aUid, const TDesC& aFile )
+            : iUid( aUid ), iFile( aFile )
+            {}
+        TUid iUid;
+        TFileName iFile;
+    };
+
+
+/**
+* CGSProfilesPlugin.
+*
+* This class handles state and application logic of CGSProfilesPlugin.
+* The plugin is a type of EGSItemTypeSettingDialog and therefore the GS FW will
+* call HandleSelection() instead of DoActivate(). No CAknView functionality is
+* supported even though the base class is CAknView derived via
+* CGSPluginInterface.
+*
+*/
+class CGSProfilesPlugin : public CGSPluginInterface,
+                          public MAknServerAppExitObserver // Embedding
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS two-phased constructor
+        * @return
+        */
+        static CGSProfilesPlugin* NewL( TAny* aInitParams );
+
+        /**
+        * Destructor.
+        */
+        ~CGSProfilesPlugin();
+
+    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.
+        */
+        CGulIcon* CreateIconL( const TUid aIconType );
+
+    protected: // New
+
+        /**
+        * C++ default constructor.
+        */
+        CGSProfilesPlugin();
+
+        /**
+        * 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:
+
+        /**
+        * Opens localized resource file.
+        */
+        void OpenLocalizedResourceFileL(
+            const TDesC& aResourceFileName,
+            RConeResourceLoader& aResourceLoader );
+
+        /**
+        * Launches provisioning application.
+        */
+        void LaunchProfilesAppL();
+        
+        /**
+        * Launches application as embedded.
+        */
+        void EmbedAppL( const TAppInfo& aApp );
+        
+    protected:
+
+        // Resource loader.
+        RConeResourceLoader iResources;
+        
+        CAknNullService* iNullService;
+        
+        CApaDocument* iEmbedded;
+    };
+
+
+
+
+class TPsmSettingItems
+    {
+    public:
+        TInt iVibraAlert;
+        TInt iKeypadVolume;
+        TInt iTactileFeedback;
+        TInt iAudioFeedback;
+    };
+
+
+/**
+* CPSMProfilesPlugin.
+*
+* Psm server calls this plugin is when power save mode changes. Plugin
+* is needed for writing psm specific setting values into profile 
+* central repository. These settings are vibrating alert, keypad volume,
+* tactile feedback and audio feedback. Psm values come from
+* psm server which reads them from CPSMProfilesPlugin .xml file
+* (10283386.xml).
+*
+*/
+class CPSMProfilesPlugin : public CPsmPluginBase
+    {
+    public:
+        
+        /**
+        * Two-phased constructor.
+		* @return The created object.
+        */
+        static CPSMProfilesPlugin* NewL( TPsmPluginCTorParams& initParams );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CPSMProfilesPlugin();
+
+	private:
+	    CPSMProfilesPlugin( TPsmPluginCTorParams& aInitParams );
+	    void ConstructL();
+	    
+
+    public: // From CPsmPluginBase
+        void NotifyModeChange( const TInt aMode );
+
+	private:
+	    void NotifyModeChangeL( const TInt aMode );
+        void GetPsmConfigSettingsL( TPsmSettingItems& aItems );
+	    void GetActiveProfileSettingsL( TPsmSettingItems& aItems );
+	    //void GetActiveProfileSettings2L( TPsmSettingItems& aItems );
+	    TUint32 ResolveKey( TUint aPartialKey, TInt aProfileId );
+	    void CPSMProfilesPlugin::Panic( TInt aReason );
+    };
+
+
+
+
+#endif // GSPROFILESPLUGIN_H
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/GSProfilesPlugin/loc/GSProfilesPlugin.loc	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  Localization strings for GSProfilesPlugin.
+*
+*/
+
+
+//  LOCALISATION STRINGS
+
+// **CAPTIONS
+
+//d:Text of a list item in main view list
+//d:Used by GS FW
+//l:list_single_large_graphic_pane_t1
+//w:
+//r: 5.0
+#define qtn_cp_folder_profiles "Profiles"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/GSProfilesPlugin/src/GSProfilesPlugin.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,587 @@
+/*
+* 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:  GSProfilesPlugin implementation.
+*
+*/
+
+
+// User includes
+#include    "GSProfilesPlugin.h"
+#include    <gsparentplugin.h>
+#include    <gscommon.hrh>
+#include    <gsprofilespluginrsc.rsg> // GUI Resource
+#include    <gsprofilesplugin.mbg>
+#include    <gsprivatepluginproviderids.h>
+#include    <ProfileEngineSDKCRKeys.h>
+#include    <hwrmvibrasdkcrkeys.h>
+
+// System includes
+#include    <apadoc.h>
+#include    <AknNullService.h>
+#include    <bautils.h>
+#include    <StringLoader.h>
+#include    <centralrepository.h>
+
+#include    <ProEngFactory.h>
+#include    <MProfileEngine.h>
+#include    <MProfile.h>
+#include    <MProfileTones.h>
+#include    <MProEngToneSettings.h>
+#include    <MProfileExtraSettings.h>
+#include    <MProfileFeedbackSettings.h>
+#include    <TProfileToneSettings.h>
+
+#include    <ProfileEng.hrh>
+#include    <ProfileEngineInternalCRKeys.h>
+
+// PSM client
+#include <psmclient.h>
+#include <psmsettings.h>
+#include <e32property.h>
+#include <MProfileEngineExtended.h>
+#include <MProfileExtended.h>
+#include <ProfileEnginePrivatePSKeys.h>
+
+
+// ========================= MEMBER FUNCTIONS ================================
+
+// ---------------------------------------------------------------------------
+// CGSProfilesPlugin::CGSProfilesPlugin
+//
+// ---------------------------------------------------------------------------
+//
+CGSProfilesPlugin::CGSProfilesPlugin()
+    : iResources( *iCoeEnv ), iNullService(NULL)
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSProfilesPlugin::~CGSProfilesPlugin
+//
+// ---------------------------------------------------------------------------
+//
+CGSProfilesPlugin::~CGSProfilesPlugin()
+    {
+    iResources.Close();
+
+    if ( iNullService )
+        {
+        delete iNullService;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSProfilesPlugin::ConstructL
+//
+// ---------------------------------------------------------------------------
+//
+void CGSProfilesPlugin::ConstructL()
+    {
+    OpenLocalizedResourceFileL( KGSProfilesPluginResourceFileName, iResources );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSProfilesPlugin::NewL
+//
+// ---------------------------------------------------------------------------
+//
+CGSProfilesPlugin* CGSProfilesPlugin::NewL( TAny* /*aInitParams*/ )
+    {
+    CGSProfilesPlugin* self = new ( ELeave ) CGSProfilesPlugin();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSProfilesPlugin::Id (from CGSPluginInterface)
+//
+// -----------------------------------------------------------------------------
+//
+TUid CGSProfilesPlugin::Id() const
+    {
+    return KGSProfilesPluginImplUID;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSProfilesPlugin::DoActivateL (from CGSPluginInterface)
+//
+// -----------------------------------------------------------------------------
+//
+void CGSProfilesPlugin::DoActivateL( const TVwsViewId& /*aPrevViewId*/,
+                                  TUid /*aCustomMessageId*/,
+                                  const TDesC8& /*aCustomMessage*/ )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSProfilesPlugin::DoDeactivate (from CGSPluginInterface)
+//
+// -----------------------------------------------------------------------------
+//
+void CGSProfilesPlugin::DoDeactivate()
+    {
+    }
+
+
+
+// -----------------------------------------------------------------------------
+// CGSProfilesPlugin::GetCaptionL (from CGSPluginInterface)
+//
+// -----------------------------------------------------------------------------
+//
+void CGSProfilesPlugin::GetCaptionL( TDes& aCaption ) const
+    {
+    HBufC* result = StringLoader::LoadL( R_GS_PROFILES_PLUGIN_CAPTION );
+    
+    if (result->Des().Length() < aCaption.MaxLength())
+        {
+        aCaption.Copy( *result );    
+        }
+    else
+        {
+        aCaption = KNullDesC;
+        }
+   
+    delete result;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSProfilesPlugin::PluginProviderCategory (from CGSPluginInterface)
+//
+// -----------------------------------------------------------------------------
+//
+TInt CGSProfilesPlugin::PluginProviderCategory() const
+    {
+    return KGSPluginProviderInternal;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSProfilesPlugin::ItemType (from CGSPluginInterface)
+//
+// -----------------------------------------------------------------------------
+//
+TGSListboxItemTypes CGSProfilesPlugin::ItemType()
+    {
+    return EGSItemTypeSettingDialog;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSProfilesPlugin::GetValue (from CGSPluginInterface)
+//
+// -----------------------------------------------------------------------------
+//
+void CGSProfilesPlugin::GetValue( const TGSPluginValueKeys /*aKey*/,
+                                      TDes& /*aValue*/ )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSProfilesPlugin::HandleSelection (from CGSPluginInterface)
+//
+// -----------------------------------------------------------------------------
+//
+void CGSProfilesPlugin::HandleSelection(
+    const TGSSelectionTypes /*aSelectionType*/ )
+    {
+    TRAP_IGNORE( LaunchProfilesAppL() );
+    }
+
+// ---------------------------------------------------------------------------
+// CGSProfilesPlugin::CreateIconL (from CGSPluginInterface)
+//
+// ---------------------------------------------------------------------------
+//
+
+CGulIcon* CGSProfilesPlugin::CreateIconL( const TUid aIconType )
+    {
+    CGulIcon* icon;
+    TParse* fp = new ( ELeave ) TParse();
+    CleanupStack::PushL( fp );
+    fp->Set( KGSProfilesPluginIconDirAndName, &KDC_BITMAP_DIR, NULL );
+
+    if ( aIconType == KGSIconTypeLbxItem )
+        {
+        icon = AknsUtils::CreateGulIconL(
+        AknsUtils::SkinInstance(),
+        KAknsIIDQgnPropCpPersoProf,
+        fp->FullName(),
+        EMbmGsprofilespluginQgn_prop_cp_perso_prof,
+        EMbmGsprofilespluginQgn_prop_cp_perso_prof_mask );
+        }    
+    else
+        {
+        icon = CGSPluginInterface::CreateIconL( aIconType );
+        }
+
+    CleanupStack::PopAndDestroy( fp );
+
+    return icon;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSProfilesPlugin::OpenLocalizedResourceFileL
+//
+// -----------------------------------------------------------------------------
+//
+void CGSProfilesPlugin::OpenLocalizedResourceFileL(
+    const TDesC& aResourceFileName,
+    RConeResourceLoader& aResourceLoader )
+    {
+    RFs fsSession;
+    User::LeaveIfError( fsSession.Connect() );
+    CleanupClosePushL(fsSession);
+
+    // 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 );
+
+    CleanupStack::PopAndDestroy(&fsSession);
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSProfilesPlugin::LaunchProfilesAppL
+//
+// -----------------------------------------------------------------------------
+//
+void CGSProfilesPlugin::LaunchProfilesAppL()
+    {
+    // Get the correct application data
+    RWsSession ws;
+    User::LeaveIfError(ws.Connect());
+    CleanupClosePushL(ws);
+
+    // Find the task with uid
+    TApaTaskList taskList(ws);
+    TApaTask task = taskList.FindApp( KGsProfilesAppUid );
+
+    if ( task.Exists() )
+        {
+        task.BringToForeground();
+        }
+    else
+        {
+        //Launch Profiles application as embedded
+        TAppInfo app( KGsProfilesAppUid, KGSProfilesApp );
+        iEmbedded=NULL;
+        EmbedAppL( app );
+        }
+    CleanupStack::PopAndDestroy(&ws);
+    }
+
+
+// -----------------------------------------------------------------------------
+// CGSProfilesPlugin::EmbedAppL
+//
+// -----------------------------------------------------------------------------
+//
+void CGSProfilesPlugin::EmbedAppL( const TAppInfo& aApp )
+    {
+    // Launch settings app
+    if ( iNullService )
+        {
+        delete iNullService;
+        iNullService = NULL;
+        }
+    iNullService = CAknNullService::NewL( aApp.iUid, this );
+    }
+
+
+
+/******************************************************************************
+ * class CPSMProfilesPlugin                  
+ ******************************************************************************/
+
+
+//
+// config file goes to:
+// \epoc32\release\winscw\udeb\Z\private\2000B187 (emulator)
+// \epoc32\data\Z\private\2000B187  (image)
+//
+
+
+
+// ----------------------------------------------------------------------------------
+// CPSMProfilesPlugin::CPSMProfilesPlugin()
+// ----------------------------------------------------------------------------------
+//  
+CPSMProfilesPlugin::CPSMProfilesPlugin( TPsmPluginCTorParams& aInitParams ) :
+    CPsmPluginBase( aInitParams )
+	{	
+	}
+
+// -----------------------------------------------------------------------------
+// CPSMProfilesPlugin::ConstructL(
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CPSMProfilesPlugin::ConstructL()
+    {
+    }
+    
+
+// ----------------------------------------------------------------------------------
+// CPSMProfilesPlugin::NewL() 
+// ----------------------------------------------------------------------------------
+//  
+CPSMProfilesPlugin* CPSMProfilesPlugin::NewL( TPsmPluginCTorParams& aInitParams )
+	{
+	CPSMProfilesPlugin* self = new ( ELeave ) CPSMProfilesPlugin( aInitParams );
+
+	CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+	}
+	
+
+// ----------------------------------------------------------------------------------
+// CPSMProfilesPlugin::~CPSMProfilesPlugin()
+// ----------------------------------------------------------------------------------
+//  
+CPSMProfilesPlugin::~CPSMProfilesPlugin()
+	{
+	}
+
+
+
+// ----------------------------------------------------------------------------------
+// CPSMProfilesPlugin::NotifyModeChange (from CPsmPluginBase)
+// ----------------------------------------------------------------------------------
+//  
+void CPSMProfilesPlugin::NotifyModeChange( const TInt aMode )
+    {
+    TInt ignoreError = KErrNone;
+    
+    TRAP( ignoreError, NotifyModeChangeL( aMode) );
+    }
+
+
+// ----------------------------------------------------------------------------------
+// CPSMProfilesPlugin::NotifyModeChangeL()
+// ----------------------------------------------------------------------------------
+//  
+void CPSMProfilesPlugin::NotifyModeChangeL( const TInt aMode )
+    {
+    TPsmSettingItems set;
+
+    if ( aMode == EPsmsrvModeNormal || aMode == EPsmsrvPartialMode )
+        {
+        GetActiveProfileSettingsL( set );
+        }
+    else if ( aMode == EPsmsrvModePowerSave )
+        {
+        GetPsmConfigSettingsL( set );
+        }
+    else
+        {
+        User::Leave( KErrUnknown );
+        }
+    
+    CRepository* cenrep = CRepository::NewLC( KCRUidVibraCtrl );
+    User::LeaveIfError( cenrep->Set( KVibraCtrlProfileVibraEnabled, 
+    		set.iVibraAlert ) );
+    User::LeaveIfError( cenrep->Set( KVibraCtrlProfileFeedbackEnabled, 
+    		set.iTactileFeedback ) );
+    CleanupStack::PopAndDestroy( cenrep );
+    
+    cenrep = CRepository::NewLC( KCRUidProfileEngine );
+    User::LeaveIfError( cenrep->Set( KProEngActiveKeypadVolume, 
+    		set.iKeypadVolume ) );
+    User::LeaveIfError( cenrep->Set( KProEngActiveAudioFeedback, 
+    		set.iAudioFeedback ) );
+    User::LeaveIfError( cenrep->Set( KProEngActiveTactileFeedback, 
+    		set.iTactileFeedback ) );
+    CleanupStack::PopAndDestroy( cenrep );
+
+    // Set up internal PSM PubSub key
+    _LIT_SECURITY_POLICY_PASS( KProfileEngReadPolicy );
+    const TSecurityPolicy KProfileEngWritePolicy( ECapabilityWriteDeviceData );
+    TInt err = RProperty::Define( KPSUidProfileEngine, 
+    		KProEngPsmChanged, RProperty::EInt,
+    		KProfileEngReadPolicy, KProfileEngWritePolicy );
+    if( err == KErrNone || err == KErrAlreadyExists )
+        {
+        RProperty::Set( KPSUidProfileEngine, KProEngPsmChanged, aMode );
+
+        // Notify engine about power save mode change
+        MProfileEngine* profileEngine = CreateProfileEngineL();
+        CleanupReleasePushL( *profileEngine );
+        TInt activeProfileId = profileEngine->ActiveProfileId();
+        CleanupStack::PopAndDestroy( profileEngine );
+
+        MProfileEngineExtended* engine = CreateProfileEngineExtendedL();
+        CleanupReleasePushL( *engine );
+        MProfileExtended* profile = engine->ProfileL( activeProfileId );
+        CleanupReleasePushL( *profile );
+        
+        // CommitChangeL is needed so that an event will be created for profile
+        // modification listeners.
+        engine->CommitChangeL( *profile );
+        
+        CleanupStack::PopAndDestroy( profile );
+        CleanupStack::PopAndDestroy( engine );
+        }
+
+    }
+
+
+// ----------------------------------------------------------------------------------
+// CPSMProfilesPlugin::GetActiveProfileSettingsL()
+// ----------------------------------------------------------------------------------
+//
+void CPSMProfilesPlugin::GetActiveProfileSettingsL( TPsmSettingItems& aSettings )
+    {
+    CRepository* repository = CRepository::NewLC( KCRUidProfileEngine );
+    
+    TInt activeProfile = KErrNotFound;
+    User::LeaveIfError( repository->Get( KProEngActiveProfile, activeProfile ) );
+        
+    TInt num = ResolveKey( EProfileSettingIdVibra, activeProfile );
+    User::LeaveIfError( repository->Get( num, aSettings.iVibraAlert ) );
+    
+    num = ResolveKey( EProfileSettingIdKeypadVolume, activeProfile );
+    User::LeaveIfError( repository->Get( num, aSettings.iKeypadVolume ) );
+    
+    num = ResolveKey( EProfileSettingIdTactileFeedback, activeProfile );
+    User::LeaveIfError( repository->Get( num, aSettings.iTactileFeedback ) );
+
+    num = ResolveKey( EProfileSettingIdAudioFeedback, activeProfile );
+    User::LeaveIfError( repository->Get( num, aSettings.iAudioFeedback ) );
+
+    CleanupStack::PopAndDestroy( repository );
+    
+    return;
+    }
+
+
+// ----------------------------------------------------------------------------------
+// CPSMProfilesPlugin::GetActiveProfileSettingsL()
+// ----------------------------------------------------------------------------------
+//
+/*
+void CPSMProfilesPlugin::GetActiveProfileSettings2L( TPsmSettingItems& aSettings )
+    {
+    MProfileEngine* profileEngine = CreateProfileEngineL();
+    CleanupReleasePushL( *profileEngine );
+    
+    MProfile* activeProfile  = profileEngine->ActiveProfileLC();
+    
+    const MProfileTones& tones = activeProfile->ProfileTones();
+    const TProfileToneSettings& ts = tones.ToneSettings();
+    
+    aSettings.iVibraAlert  = ts.iVibratingAlert;
+    aSettings.iKeypadVolume = ts.iKeypadVolume;
+    
+    const MProfileExtraSettings& extra = activeProfile->ProfileExtraSettings();
+    const MProfileFeedbackSettings& feedBack = extra.ProfileFeedbackSettings();
+    aSettings.iTactileFeedback = feedBack.TactileFeedback();
+    aSettings.iAudioFeedback = feedBack.AudioFeedback();
+
+    CleanupStack::PopAndDestroy();  // profile
+    CleanupStack::PopAndDestroy( profileEngine );
+    }
+*/
+
+// ----------------------------------------------------------------------------------
+// CPSMProfilesPlugin::GetPsmConfigSettingsL()
+// ----------------------------------------------------------------------------------
+//  
+void CPSMProfilesPlugin::GetPsmConfigSettingsL( TPsmSettingItems& aSettings )
+    {
+    RConfigInfoArray arr;
+    CleanupClosePushL( arr );
+   
+    TPsmsrvConfigInfo info;
+    info.iConfigId = EPsmPluginKeyVibra;
+    info.iConfigType = EConfigTypeInt;
+    info.iIntValue = KErrNotFound;
+    User::LeaveIfError( arr.Append( info ) );
+
+    info.iConfigId = EPsmPluginKeyKbdVolume;
+    info.iConfigType = EConfigTypeInt;
+    info.iIntValue = KErrNotFound;
+    User::LeaveIfError( arr.Append( info ) );
+
+    info.iConfigId = EPsmPluginTactileFeedback ;
+    info.iConfigType = EConfigTypeInt;
+    info.iIntValue = KErrNotFound;
+    User::LeaveIfError( arr.Append( info ) );
+
+    info.iConfigId = EPsmPluginAudioFeedback;
+    info.iConfigType = EConfigTypeInt;
+    info.iIntValue = KErrNotFound;
+    User::LeaveIfError( arr.Append( info ) );
+
+    iSettingsProvider.GetSettingsL( arr, KGSProfilesPluginUID.iUid );
+        
+    aSettings.iVibraAlert = arr[0].iIntValue;
+    aSettings.iKeypadVolume = arr[1].iIntValue;
+    aSettings.iTactileFeedback = arr[2].iIntValue;
+    aSettings.iAudioFeedback = arr[3].iIntValue;
+
+    CleanupStack::PopAndDestroy( &arr );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPSMProfilesPlugin::ResolveKey
+//
+// -----------------------------------------------------------------------------
+//
+TUint32 CPSMProfilesPlugin::ResolveKey( TUint aPartialKey, TInt aProfileId )
+    {
+    const TInt KProfileIdShift = 24;
+    
+    return ( ( aProfileId << KProfileIdShift ) | aPartialKey );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CPSMProfilesPlugin::Panic
+//
+// -----------------------------------------------------------------------------
+//    
+void CPSMProfilesPlugin::Panic( TInt aReason )
+    {
+	_LIT(KPanicCategory,"CPSMProfilesPlugin");
+	
+	User::Panic(KPanicCategory, aReason); 
+    }
+
+
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/GSProfilesPlugin/src/GSProfilesPluginImplementationTable.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  ECOM proxy table for GSProfilesPlugin.
+*
+*/
+
+
+// User includes
+#include "GSProfilesPlugin.h"
+
+// System includes
+#include <e32std.h>
+#include <implementationproxy.h>
+
+
+// Constants
+const TImplementationProxy KGSProfilesPluginImplementationTable[] =
+    {
+    IMPLEMENTATION_PROXY_ENTRY( 0x10283387, CGSProfilesPlugin::NewL ),
+    IMPLEMENTATION_PROXY_ENTRY( 0x10283388, CPSMProfilesPlugin::NewL )
+    };
+
+
+// ---------------------------------------------------------------------------
+// ImplementationGroupProxy
+// Gate/factory function
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
+    TInt& aTableCount )
+    {
+    RDebug::Print( _L( "[GSLog] ImplementationGroupProxy()" ) );
+    aTableCount = sizeof( KGSProfilesPluginImplementationTable )
+        / sizeof( TImplementationProxy );
+    return KGSProfilesPluginImplementationTable;
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/Group/Profiles.lnt	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,37 @@
+/** Unused Enum scan
+-e???? +e749
+*/
+
+/** Unused header scan
+-e???? +e766
+*/
+
+/** standard lint check
+*/
+-w1 -e322
+
+/** define unicode
+-D_UNICODE
+*/
+
+/** Standard include directories */
+-i..\profileengine\doc
+-i..\profileengine\group
+-i..\profileengine\inc
+-i..\profileengine\src
+-i..\profileengine\EngInc
+-i..\profileengine\EngSrc
+-i..\profileapp\aif
+-i..\profileapp\doc
+-i..\profileapp\group
+-i..\profileapp\help
+-i..\profileapp\uisrc
+-i..\profileapp\settingsviewinc
+-i..\profileapp\settingsviewsrc
+-i\epoc32\include
+-i\epoc32\include\oem
+
+/** Examined application source directories */
+..\profileengine\EngSrc\*.cpp
+..\profileapp\uisrc\*.cpp
+..\profileapp\settingsviewsrc\*.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/Group/ProfilesDebug.h	Wed Sep 01 12:30:29 2010 +0100
@@ -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/profilesapplication/Profiles/Group/ProfilesUID.h	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,34 @@
+/*
+* 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 __PROFILESUID_H__
+#define __PROFILESUID_H__
+
+#define KEComRecognitionUID2 0x10009d8d
+
+#define INTERFACE_UID_PROFILEENG_PEC 0x101f85b4
+#define IMPLEMENTATION_UID_PROFILEENG_PEC 0x101f85b5
+
+#define INTERFACE_UID_PROFILESETTINGSVIEW_PEC 0x101f85b6
+#define IMPLEMENTATION_UID_PROFILESETTINGSVIEW_PEC 0x101f85b7
+
+#define IMPLEMENTATION_UID_PROFILES_GS_TONES_PLUGIN 0x1020729b
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/Group/bld.inf	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,68 @@
+/*
+* 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
+*    whole of Profiles
+*
+*/
+
+// To get the APP_LAYER_PLATFORM_EXPORT_PATH-definition
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+    DEFAULT
+
+PRJ_EXPORTS
+
+#include "../GSProfilesPlugin/group/GSProfilesPluginExports.inc"
+#include "../ProfileAiwProvider/group/ProfileAiwProviderExports.inc"
+#include "../ProfileApp/group/ProfileAppExports.inc"
+
+../rom/Profile.iby CORE_APP_LAYER_IBY_EXPORT_PATH(profile.iby)
+../rom/ProfileResources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(profileresources.iby)
+
+PRJ_EXTENSIONS
+
+START EXTENSION s60/mifconv
+OPTION TARGETFILE profileapp_aif.mif
+OPTION SOURCES -c8,8 qgn_menu_mode
+END
+
+START EXTENSION s60/mifconv
+OPTION TARGETFILE gsprofilesplugin.mif
+OPTION HEADERFILE gsprofilesplugin.mbg
+OPTION SOURCES -c8,8 qgn_prop_cp_perso_prof
+END
+PRJ_MMPFILES
+
+//#ifdef __SCALABLE_ICONS
+//	gnumakefile ../ProfileApp/group/icons_aif_scalable_dc.mk
+//#else
+	//gnumakefile ../ProfileApp/group/icons_aif_bitmaps_dc.mk
+//#endif // __SCALABLE_ICONS
+
+../ProfileApp/group/ProfileSettingsView.mmp
+../ProfileApp/group/ProfileApp.mmp
+#ifdef RD_GS_RENOVATION
+#ifndef RD_CONTROL_PANEL
+../ProfilesGSTonesPlugin/group/ProfilesGSTonesPlugin.mmp
+#endif // RD_CONTROL_PANEL
+#ifdef RD_CONTROL_PANEL
+//gnumakefile ../GSProfilesPlugin/group/GSProfilesPluginIcons.mk
+../GSProfilesPlugin/group/GSProfilesPlugin.mmp
+#endif // RD_CONTROL_PANEL
+#endif // RD_GS_RENOVATION
+
+../ProfileAiwProvider/group/ProfileAiwProvider.mmp
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileAiwProvider/group/ProfileAiwProvider.mmp	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  Project definition file for ProfileAiwProvider
+*
+*/
+
+#include "ProfileAiwProviderUid.h"
+// To get the APP_LAYER_SYSTEMINCLUDE-definition
+#include <platform_paths.hrh>
+#include <data_caging_paths.hrh>
+
+TARGET          profileaiwprovider.dll
+TARGETTYPE      PLUGIN
+UID             KEComRecognitionUID2 KProfileAiwProviderDllUid
+CAPABILITY      CAP_ECOM_PLUGIN
+VENDORID        VID_DEFAULT
+
+SOURCEPATH      ../src
+SOURCE          Dllmain.cpp
+SOURCE          CProfileAiwProvider.cpp
+SOURCE          CPapPopupList.cpp
+
+USERINCLUDE     ../rss
+USERINCLUDE     ../group 
+USERINCLUDE     ../../ProfileApp/SettingsViewInc
+USERINCLUDE     ../../ProfileApp/group
+SYSTEMINCLUDE	../../../inc
+
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   /epoc32/include/ecom
+
+SOURCEPATH      ../rss
+
+START RESOURCE ProfileAiwProviderResource.rss
+ HEADER
+ TARGETPATH      RESOURCE_FILES_DIR
+ LANGUAGE_IDS
+END
+
+// ECom resource
+START RESOURCE 10281F18.rss 
+ TARGET profileaiwprovider.rsc
+END
+
+
+LIBRARY euser.lib
+LIBRARY cone.lib 
+LIBRARY commonengine.lib
+LIBRARY avkon.lib
+LIBRARY servicehandler.lib
+LIBRARY efsrv.lib
+LIBRARY	bafl.lib
+LIBRARY	profilesettingsview.lib
+LIBRARY aknskins.lib
+LIBRARY eikcoctl.lib 
+LIBRARY centralrepository.lib 
+LIBRARY featmgr.lib // Feature Manager
+LIBRARY egul.lib	// CGulIcon 
+LIBRARY eikcore.lib
+LIBRARY platformenv.lib
+
+#ifdef RD_DRM_COMMON_INTERFACE_FOR_OMA_AND_WMDRM
+LIBRARY drmutility.lib
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileAiwProvider/group/ProfileAiwProviderExports.inc	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,30 @@
+/*
+* ==============================================================================
+*  Name        : ProfileAiwProviderExports.inc
+*  Part of     : ProfileAiwProvider
+*  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 PROFILEAIWPROVIDEREXPORTS_INC
+#define PROFILEAIWPROVIDEREXPORTS_INC
+
+../loc/ProfileAiwProvider.loc    APP_LAYER_LOC_EXPORT_PATH(profileaiwprovider.loc)
+
+#endif      // PROFILEAIWPROVIDEREXPORTS_INC
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileAiwProvider/group/ProfileAiwProviderUid.h	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,25 @@
+/*
+* 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:  Uids for profile Aiw service.
+*
+*/
+
+#ifndef __PROFILEAIWPROVIDER_H__
+#define __PROFILEAIWPROVIDER_H__
+
+#define KProfileAiwProviderDllUid  0x10281F18
+#define KProfileAiwProviderImplUid 0x10281F18
+#define KEComRecognitionUID2 0x10009D8D
+
+#endif // __PROFILEAIWPROVIDER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileAiwProvider/group/bld.inf	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  This file provides the information required for building ProfileAiwProvider
+*
+*/
+// To get the APP_LAYER_LOC_EXPORT_PATH-definition
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+#include "ProfileAiwProviderExports.inc"
+
+PRJ_MMPFILES
+ProfileAiwProvider.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileAiwProvider/loc/ProfileAiwProvider.loc	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  ProfileAiwProvider localisation strings.
+*
+*/
+
+
+
+// LOCALISATION STRINGS
+
+//d:Command in options list
+//d:Uses tone as ringing tone
+//l:list_single_popup_submenu_pane_t1
+//w:
+//r:3.1
+#define qtn_mg_options_set_as_rt                    "Set as ringing tone"
+
+//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: ListBox dialog header
+//l: heading_pane_t1
+//w:
+//r:3.1
+#define qtn_profiles_query_select_profiles           "Select profiles:"
+
+//d: Error message text for non-supported file formats
+//l: popup_note_window 
+//w:
+//r:3.1
+#define qtn_profiles_info_mime_type_not_supported			"Files of this format cannot be set as ringing tone."
+
+//d: Information note for changed profiles
+//l: popup_note_window 
+//w:
+//r:3.1
+#define qtn_profiles_confirm_ringtone_changed		"Ringing tone changed for selected profiles."
+
+//d: Information note shown when a file is copied from a remote drive
+//l: popup_note_window 
+//w:
+//r:5.0
+#define qtn_profiles_info_remote_drive_copy		"File copied to Gallery and set as ringing tone for selected profiles."
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileAiwProvider/rss/10281F18.rss	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,52 @@
+/*
+* 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:  ProfileAiwProvider resources
+*
+*/
+
+// INCLUDES
+#include <ecom/registryinfov2.rh>
+#include <AiwCommon.hrh>
+#include "ProfileAiwProviderUid.h"
+
+// -----------------------------------------------------------------------------
+//
+// theInfo
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE REGISTRY_INFO theInfo
+    {
+    resource_format_version = RESOURCE_FORMAT_VERSION_2;
+    dll_uid = KProfileAiwProviderDllUid;
+    interfaces =
+        {
+        INTERFACE_INFO
+            {
+            interface_uid = KAiwClassMenu;
+            implementations =
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = KProfileAiwProviderImplUid;
+                    version_no = 1;
+                    display_name = "";
+                    default_data = "*";
+                    opaque_data = KAiwCmdAssignStr; // for KAiwCmdAssign command id
+                    }
+                };
+            }
+        };
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileAiwProvider/rss/ProfileAiwProviderResource.rss	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,150 @@
+/*
+* 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:  ProfileAiwProvider resources
+*
+*/
+
+
+//  RESOURCE IDENTIFIER
+NAME    AIPP 
+
+// INTERNAL INCLUDES
+#include <profileaiwprovider.loc>
+#include <profileapp.loc>	// For qtn_profiles_tone_maxsize_error
+
+// EXTERNAL INCLUDES
+#include <eikon.rh>	// For RESOURCE MENU_PANE
+#include <AiwCommon.hrh> // For KAiwCmdView
+#include <avkon.loc>	// For text_not_allowed
+
+//  RESOURCE DEFINITIONS
+
+RESOURCE RSS_SIGNATURE { }
+    
+// -----------------------------------------------------------------------------
+//
+// r_profileaiwprovider_menu
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_profileaiwprovider_menu
+    {
+    items=
+        {
+        MENU_ITEM
+            {
+            command = KAiwCmdAssign;
+            txt = qtn_mg_options_set_as_rt;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profileaiwprovider_info_tone_drm_protected
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_profileaiwprovider_info_tone_drm_protected
+	{
+	buf = qtn_profiles_info_tone_drm_protected;
+	}   
+
+// -----------------------------------------------------------------------------
+//
+// r_profileaiwprovider_text_not_allowed
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_profileaiwprovider_text_not_allowed
+	{
+	buf = text_not_allowed;
+	}
+	
+// -----------------------------------------------------------------------------
+//
+// r_profileaiwprovider_info_tone_no_drm
+// ?description
+//
+// -----------------------------------------------------------------------------
+//	
+RESOURCE TBUF r_profileaiwprovider_info_tone_no_drm	
+	{
+	buf = qtn_profiles_info_tone_no_drm;
+	}
+
+// -----------------------------------------------------------------------------
+//
+// r_profileaiwprovider_query_select_profiles
+// ?description
+//
+// -----------------------------------------------------------------------------
+//	
+RESOURCE TBUF r_profileaiwprovider_query_select_profiles
+	{
+	buf = qtn_profiles_query_select_profiles;
+	}
+	
+// -----------------------------------------------------------------------------
+//
+// r_profileaiwprovider_info_mime_type_not_supported
+// ?description
+//
+// -----------------------------------------------------------------------------
+//	
+RESOURCE TBUF r_profileaiwprovider_info_mime_type_not_supported
+	{
+	buf = qtn_profiles_info_mime_type_not_supported;
+	}	
+
+// -----------------------------------------------------------------------------
+//
+// r_profileaiwprovider_confirm_ringtone_changed
+// ?description
+//
+// -----------------------------------------------------------------------------
+//	
+RESOURCE TBUF r_profileaiwprovider_confirm_ringtone_changed
+	{
+	buf = qtn_profiles_confirm_ringtone_changed;
+	}
+	
+// -----------------------------------------------------------------------------
+//
+// r_profileaiwprovider_tone_maxsize_error
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_profileaiwprovider_tone_maxsize_error
+	{
+	buf = qtn_profiles_tone_maxsize_error;
+	}
+	
+// -----------------------------------------------------------------------------
+//
+// r_profileaiwprovider_confirm_ringtone_copied
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_profileaiwprovider_confirm_ringtone_copied
+	{
+	buf = qtn_profiles_info_remote_drive_copy;
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileAiwProvider/src/CPapPopupList.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  A thin CAknPopupList extension.
+*
+*/
+
+
+
+// CLASS HEADER
+#include "CPapPopupList.h"
+
+// INTERNAL INCLUDES
+
+// EXTERNAL INCLUDES
+#include <AknIconArray.h>
+#include <aknlists.h>
+#include <AknsSkinInstance.h>
+#include <AknsUtils.h>
+#include <aknconsts.h>
+#include <avkon.mbg>
+#include <gulicon.h>
+
+// CONSTANTS
+namespace
+	{
+	// Granularities
+	const TInt KIconGranularity( 3 );
+	}
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CPapPopupList::CPapPopupList
+// C++ constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CPapPopupList::CPapPopupList()
+	: CAknPopupList()
+    {
+    }
+
+
+void CPapPopupList::ConstructL( CEikListBox* aListBox, TInt aCbaResource )
+	{
+    CAknPopupList::ConstructL( aListBox, aCbaResource, AknPopupLayouts::EMenuWindow );
+	}
+
+// -----------------------------------------------------------------------------
+// CPapPopupList::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CPapPopupList* CPapPopupList::NewL( CEikListBox* aListBox, TInt aCbaResource )
+	{
+	CPapPopupList* self = new( ELeave ) CPapPopupList();
+	CleanupStack::PushL( self );
+	self->ConstructL( aListBox, aCbaResource );
+	CleanupStack::Pop( self );
+	return self;
+	}
+
+// Destructor
+ CPapPopupList::~CPapPopupList()
+    {
+    }
+    
+// -----------------------------------------------------------------------------
+// CPapPopupList::HandleResourceChange
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPapPopupList::HandleResourceChange( TInt aType )
+    {
+    if( aType == KAknsMessageSkinChange )
+        {
+        TRAP_IGNORE( SetIconsL() );
+        }
+    CAknPopupList::HandleResourceChange( aType );
+    }
+
+// -----------------------------------------------------------------------------
+// CPapPopupList::HandleListBoxEventL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPapPopupList::HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType )
+    {
+    switch( aEventType )
+        {
+        case EEventItemClicked:
+        case EEventItemSingleClicked:
+            UpdateCba();
+            break;
+
+        default:
+            break;
+        }
+
+    CAknPopupList::HandleListBoxEventL( aListBox, aEventType );
+    }
+
+// -----------------------------------------------------------------------------
+// CPapPopupList::ProcessCommandL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPapPopupList::ProcessCommandL( TInt aCommandId )
+    {
+    switch( aCommandId )
+        {
+        // Fall through
+        case EAknSoftkeyMark:
+        case EAknSoftkeyUnmark:
+            UpdateCba();
+            break;
+            
+        default:
+            break;
+        }
+
+    CAknPopupList::ProcessCommandL( aCommandId );
+    }
+
+// -----------------------------------------------------------------------------
+// CPapPopupList::UpdateCba
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CPapPopupList::UpdateCba()
+    {
+    // Cache the pointer to button group container
+    CEikButtonGroupContainer* cba = ButtonGroupContainer();
+    // Left softkey should be visible if there are items selected,
+    // i.e. the selection index array has items.
+    TBool visible( ListBox()->View()->SelectionIndexes()->Count() > 0 );
+    // Resolve left softkey command id
+    TInt leftId( cba->ButtonGroup()->CommandId( 0 ) );
+    // Check if left softkey visibility has changed
+    if( visible != cba->IsCommandVisible( leftId ) )
+        {
+        // Left softkey visibility has changed, update it
+        cba->MakeCommandVisible( leftId, visible );
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CPapPopupList::SetIconsL
+// (other items were commented in a header).
+// ----------------------------------------------------------------------------
+//
+void CPapPopupList::SetIconsL()
+    {
+    CAknSingleGraphicPopupMenuStyleListBox* listBox = 
+    	static_cast<CAknSingleGraphicPopupMenuStyleListBox*>( ListBox() );
+
+    // Create new icon array
+    CAknIconArray* iconArray = new( ELeave ) CAknIconArray( KIconGranularity );
+    CleanupStack::PushL( iconArray );
+
+	MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+    CGulIcon* icon = CGulIcon::NewLC();
+    CFbsBitmap* bitmap = 0;
+    CFbsBitmap* mask = 0;
+    AknsUtils::CreateColorIconL( skin, KAknsIIDQgnIndiCheckboxOn,
+    	KAknsIIDQsnIconColors, EAknsCIQsnIconColorsCG15,
+    	bitmap, mask, KAvkonBitmapFile, EMbmAvkonQgn_indi_checkbox_on,
+    	EMbmAvkonQgn_indi_checkbox_on_mask, KRgbBlack  );
+    icon->SetBitmap( bitmap );
+    icon->SetMask( mask );
+    iconArray->AppendL( icon );
+    CleanupStack::Pop( icon );
+
+    icon = CGulIcon::NewLC();
+    AknsUtils::CreateColorIconL( skin, KAknsIIDQgnIndiCheckboxOff,
+    	KAknsIIDQsnIconColors, EAknsCIQsnIconColorsCG15,
+    	bitmap, mask, KAvkonBitmapFile, EMbmAvkonQgn_indi_checkbox_off,
+    	EMbmAvkonQgn_indi_checkbox_off_mask, KRgbBlack  );
+    icon->SetBitmap( bitmap );
+    icon->SetMask( mask );
+    iconArray->AppendL( icon );
+    CleanupStack::Pop( icon );
+
+    // Delete old icons
+    CArrayPtr<CGulIcon>* arr = listBox->ItemDrawer()->ColumnData()->IconArray();
+    if( arr )
+    	{
+    	arr->ResetAndDestroy();
+	    delete arr;
+	    arr = NULL;
+    	}
+
+	// Set new icon array
+    listBox->ItemDrawer()->ColumnData()->SetIconArray( iconArray );	// changes ownership
+    CleanupStack::Pop( iconArray );
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileAiwProvider/src/CPapPopupList.h	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,88 @@
+/*
+* 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:  A thin CAknPopupList extension.
+*
+*/
+
+
+
+#ifndef CPAPPOPUPLIST_H
+#define CPAPPOPUPLIST_H
+
+// EXTERNAL INCLUDES
+#include <aknPopup.h>
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  A thin CAknPopupList extension.
+*  Handles resource changes.
+*
+*  @lib ProfileSettingsView.lib
+*  @since 3.1
+*/
+NONSHARABLE_CLASS( CPapPopupList ) : public CAknPopupList
+    {
+
+    public: // New methods
+
+		/**
+		* Two-phased constructor.
+		* @param aListbox A parameter to CAknPopupList.
+		* @param aCbaResource A parameter to CAknPopupList.
+		* @param aType A parameter to CAknPopupList.
+		*/
+		static CPapPopupList* NewL( CEikListBox* aListBox, TInt aCbaResource );
+		
+		void ConstructL( CEikListBox* aListBox, TInt aCbaResource );
+
+		/**
+        * Destructor.
+        */	
+		virtual ~CPapPopupList();
+
+		/**
+		* Fills in ListBox icon array.
+		*/
+		void SetIconsL();
+
+    private: // From CAknPopupList
+
+        void HandleResourceChange( TInt aType );
+        void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType );
+        void ProcessCommandL( TInt aCommandId );
+
+    private:
+
+		/**
+		* C++ constructor.
+		*/
+		CPapPopupList();
+
+	private: // New methods
+
+	    /**
+	     * Updates softkeys.
+	     */
+	    void UpdateCba();
+	    
+    private:    // Data
+
+    };
+
+#endif      // CPAPPOPUPLIST_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileAiwProvider/src/CProfileAiwProvider.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,873 @@
+/*
+* 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 Aiw service provider.
+*
+*/
+
+
+//	CLASS HEADER
+#include "CProfileAiwProvider.h"
+
+// INTERNAL INCLUDES
+#include "CProfileEngineHandler.h"
+#include "CPapPopupList.h"
+
+//	EXTERNAL INCLUDES
+#include <AiwMenu.h>	// For CAiwMenuPane
+#include <AiwCommon.hrh> // For KAiwCmdAssign
+#include <AiwCommon.h> // For MAiwNotifyCallback
+#include <barsread.h>	// For TResourceReader
+#include <profileaiwproviderresource.rsg> // For resource texts
+#include <data_caging_path_literals.hrh>
+#include <coemain.h> // CCoeEnv
+#include <ConeResLoader.h> // RConeResourceLoader
+#include <StringLoader.h>
+#include <aknnotewrappers.h> // For CAknInformationNote
+#include <aknlists.h>	// For CAknSingleGraphicPopupMenuStyleListBox
+#include <cprofiletonehandler.h>
+#include <MProfilesNamesArray.h>
+#include <MProfileName.h>
+#include <MProfileEngineExtended.h>
+#include <MProfileExtended.h>
+#include <ProfileEngineDomainCRKeys.h>
+#include <ProfileEng.hrh>	// For PROFILES_MAX_NAME_LENGTH
+#include <eikfutil.h>	// For EikFileUtils
+#include <centralrepository.h>
+#include <featmgr.h>
+#include <pathinfo.h>
+#include <driveinfo.h>
+
+#ifdef RD_DRM_COMMON_INTERFACE_FOR_OMA_AND_WMDRM
+#include <drmutility.h>
+#include <drmagents.h>
+#endif
+
+
+//	CONSTANTS
+namespace
+	{
+	_LIT( KProfileAiwProviderResourceFileName, "z:ProfileAiwProviderResource.rsc" );
+	// Allowed MIME types
+	_LIT( KAudioCommonMimeType, "audio/*");
+	_LIT( KAudioRngMimeType,    "application/vnd.nokia.ringing-tone" );
+#ifdef RD_VIDEO_AS_RINGING_TONE	
+	_LIT( KVideoCommonMimeType, "video/*");
+	_LIT( KRMVideoMimeType, "application/vnd.rn-realmedia" );
+	_LIT( KRMVideoMimeType2, "application/x-pn-realmedia" );
+	_LIT( KSDPVideoMimeType, "application/sdp" );
+#endif	
+	// Granularities
+	const TInt KArrayGranularity( 3 );
+	// List item format
+	_LIT( KProfileAIWProviderIconAndTab, "1\t");
+	// Maximum profile name length
+	const TInt KProfileAiwProviderMaxNameLength( PROFILES_MAX_NAME_LENGTH );
+	}
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileAiwProvider::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProfileAiwProvider* CProfileAiwProvider::NewL()
+    {
+    CProfileAiwProvider* self = new(ELeave) CProfileAiwProvider;
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileAiwProvider::CProfileAiwProvider
+// C++ default constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CProfileAiwProvider::CProfileAiwProvider()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileAiwProvider::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfileAiwProvider::ConstructL()
+    {
+    FeatureManager::InitializeLibL();
+    TParse* fp = new(ELeave) TParse();
+	fp->Set(KProfileAiwProviderResourceFileName, &KDC_RESOURCE_FILES_DIR, NULL);
+	TFileName resourceFileName( fp->FullName() );
+	delete fp;
+
+    // Get language of resource file
+    BaflUtils::NearestLanguageFile( CCoeEnv::Static()->FsSession(), resourceFileName );
+    iResourceOffset = CCoeEnv::Static()->AddResourceFileL( resourceFileName );
+    iProfileToneHandler = CProfileToneHandler::NewL();
+    // Move this to PopulateListBox()
+    //iEngineHandler = CProfileEngineHandler::NewL();
+
+    TResourceReader reader;
+    CCoeEnv::Static()->CreateResourceReaderLC( reader,
+                                               R_PROFILEAIWPROVIDER_MENU );
+    // load strings from resource
+	iWMAErrorText = StringLoader::LoadL(
+        R_PROFILEAIWPROVIDER_TEXT_NOT_ALLOWED );
+	iMP4ErrorText = StringLoader::LoadL(
+        R_PROFILEAIWPROVIDER_INFO_TONE_DRM_PROTECTED );
+	iUnprotectedErrorText = StringLoader::LoadL(
+        R_PROFILEAIWPROVIDER_INFO_TONE_NO_DRM );
+	iNotSupportedErrorText = StringLoader::LoadL(
+        R_PROFILEAIWPROVIDER_INFO_MIME_TYPE_NOT_SUPPORTED );
+	iPopupTitle = StringLoader::LoadL(
+        R_PROFILEAIWPROVIDER_QUERY_SELECT_PROFILES );
+	iChangedProfilesText = StringLoader::LoadL(
+        R_PROFILEAIWPROVIDER_CONFIRM_RINGTONE_CHANGED );
+    iCopiedAndChangedText = StringLoader::LoadL(
+        R_PROFILEAIWPROVIDER_CONFIRM_RINGTONE_COPIED );
+
+    // Read the maximum limit for the size of a tone file:
+	CRepository* cenrep = CRepository::NewL( KCRUidProfileEngine );
+	CleanupStack::PushL( cenrep );
+    User::LeaveIfError( cenrep->Get( KProEngRingingToneMaxSize, iMaxSize ) );
+	CleanupStack::PopAndDestroy( cenrep );
+	iSizeErrorText = StringLoader::LoadL(
+        R_PROFILEAIWPROVIDER_TONE_MAXSIZE_ERROR, iMaxSize );
+
+	CleanupStack::PopAndDestroy(); // reader
+	}
+
+// Destructor
+CProfileAiwProvider::~CProfileAiwProvider()
+    {
+    delete iIndexToIdArray;
+	delete iWMAErrorText;
+	delete iMP4ErrorText;
+	delete iUnprotectedErrorText;
+	delete iNotSupportedErrorText;
+	delete iPopupTitle;
+	delete iChangedProfilesText;
+	delete iSizeErrorText;
+	delete iCopiedAndChangedText;
+
+	delete iProfileToneHandler;
+	delete iEngineHandler;
+    CCoeEnv::Static()->DeleteResourceFile( iResourceOffset );
+    FeatureManager::UnInitializeLib();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileAiwProvider::InitialiseL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileAiwProvider::InitialiseL( MAiwNotifyCallback& /*aFrameworkCallback*/,
+                                       const RCriteriaArray& /*aInterest*/ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileAiwProvider::HandleServiceCmdL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileAiwProvider::HandleServiceCmdL( const TInt& aCmdId,
+                                             const CAiwGenericParamList& aInParamList,
+                                             CAiwGenericParamList& /*aOutParamList*/,
+                                             TUint aCmdOptions,
+                                             const MAiwNotifyCallback* aCallback )
+    {
+     // Cope with the design problems of AIW framework
+    iConstNotifyCallback = const_cast<MAiwNotifyCallback*> (aCallback);
+
+	if( aCmdOptions & KAiwOptCancel )
+		{
+		if( iPopup )
+			{
+			iPopup->CancelPopup();
+		    iPopup = NULL;
+			}
+		return;
+		}
+
+  	if( aCmdId == KAiwCmdAssign )
+    	{
+        // Retrieve filename and file MIME type from AIW param list
+		TPtrC fileName =
+			GetAiwParamAsDescriptor(aInParamList, EGenericParamFile);
+
+		TPtrC mimeTypeString =
+			GetAiwParamAsDescriptor(aInParamList, EGenericParamMIMEType);
+
+		// Leave, if there were not given all the required parameters
+		if ((fileName == KNullDesC) || (mimeTypeString == KNullDesC))
+			{
+			return;
+			}
+
+		if( !CheckMimeTypeL( mimeTypeString ) )
+			{
+			// Not supported format
+            ShowErrorNoteL( *iNotSupportedErrorText );
+			}
+		else if( IsFileWMDRMProtectedL( fileName ) )
+			{
+			ShowErrorNoteL( *iMP4ErrorText );
+			}
+        else if( !IsToneFileSizeOkL( fileName ) )
+            {
+			// Too big file
+            ShowErrorNoteL( *iSizeErrorText );
+            }
+		else
+			{
+			LaunchL( *iPopupTitle, fileName );
+			}
+		}
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileAiwProvider::PerformProfileChangeL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileAiwProvider::PerformProfileChangeL(
+ const TDesC& aFileName, const TBool& aChangeAllProfiles ) const
+	{
+	TInt count( iSelectionArray->Count() );
+	TInt err( KErrNone );
+	TInt r( KErrNone );
+
+	// Check location of the tone and copy if needed
+	TFileName target;
+	TBool remote = CopyIfRemoteL( aFileName, target );
+
+	if( aChangeAllProfiles )
+		{
+		if( remote )
+			{
+			TRAP( r, err = iProfileToneHandler->SetToneForAllProfilesL(
+		    	EProfileRingingToneSetting, target ) );
+			}
+		else
+			{
+			TRAP( r, err = iProfileToneHandler->SetToneForAllProfilesL(
+	        	EProfileRingingToneSetting, aFileName ) );
+			}
+		}
+	else
+		{
+        TInt profileId( 0 );
+		for( TInt index(0); index < count; index++ )
+			{
+			profileId = iIndexToIdArray->At( iSelectionArray->At( index ) );
+			
+            if( remote )
+                {
+                // The first time set the tone, use SetProfileToneL to check the file
+                if ( index == 0 )
+                    {
+
+                    TRAP( r, err = iProfileToneHandler->SetProfileToneL( 
+                       profileId, EProfileRingingToneSetting, target ) );
+                    }
+                // the file has been checked at first time, use SetProfileToneL to
+                // avoid repeat check.
+                else
+                    {
+                    TRAP( r, err = iProfileToneHandler->SetProfileToneNotCheckL(
+                        profileId, EProfileRingingToneSetting, target ) );
+                    }
+                }
+            else
+                {
+                // The first time set the tone, use SetProfileToneL to check the file
+                if ( index == 0 )
+                    {
+                    TRAP( r, err = iProfileToneHandler->SetProfileToneL( profileId,
+                        EProfileRingingToneSetting, aFileName ) );
+                    }
+                // the file has been checked at first time, use SetProfileToneL to
+                // avoid repeat check.
+                else
+                    {
+                    TRAP( r, err = iProfileToneHandler->SetProfileToneNotCheckL( 
+                        profileId, EProfileRingingToneSetting, aFileName ) );                    
+                    }
+                    				
+                }
+
+            // KErrNotFound is checked for the unlikely case in which the user
+            // has first popped up the list of profiles and then switched to
+            // Profiles App and deleted a profile or more, and finally completed
+            // this "assigned to ringing tone" operation
+            if( r == KErrNotFound )
+                {
+                r = KErrNone;
+                }
+            // The case r == KErrAccessDenied needn't be checked since only
+            // those profiles that are modifiable are included in the list in
+            // PopulateListBoxL() below
+            if( r != KErrNone || err != KErrNone )
+                {
+                // no use to go on with other profiles if the tone can not be
+                // assigned as an alert tone:
+                break;
+                }
+			}
+		}
+
+	if( r == KErrPermissionDenied )
+		{
+		// Unprotected DRM tone case
+        ShowErrorNoteL( *iUnprotectedErrorText );
+		}
+	else if( r == KErrArgument )
+		{
+		// WMA case
+        ShowErrorNoteL( *iWMAErrorText );
+		}
+	else if( r != KErrNone )
+		{
+		User::Leave( r );
+		}
+
+	if ( err == KErrArgument )
+    	{
+    	// MP4 case
+        ShowErrorNoteL( *iMP4ErrorText );
+        }
+
+	if( ( err == KErrNone ) && ( r == KErrNone )  && ( count > 0 ) )
+		{
+	   	CAknConfirmationNote* note = new( ELeave ) CAknConfirmationNote( EFalse );
+	   	if( remote )
+	   		{
+	    	note->ExecuteLD( iCopiedAndChangedText->Des() );
+	   		}
+	   	else
+	   		{
+	    	note->ExecuteLD( iChangedProfilesText->Des() );
+	   		}
+   		}
+	}
+
+// -----------------------------------------------------------------------------
+// CProfileAiwProvider::LaunchL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileAiwProvider::LaunchL( const TDesC& aPopupTitle,
+                                   const TDesC& aFileName )
+	{
+	// create listbox
+ 	// list item string format: "0\tLabel" where 0 is an index to icon array
+    CEikFormattedCellListBox* listBox =
+      new ( ELeave ) CAknSingleGraphicPopupMenuStyleListBox;
+	CleanupStack::PushL( listBox );
+
+    // create popup
+    CPapPopupList* popup = CPapPopupList::NewL( listBox,
+    	R_AVKON_SOFTKEYS_OK_CANCEL__UNMARK );
+ 	CleanupStack::PushL( popup );
+ 	popup->SetTitleL( aPopupTitle );
+
+#ifdef RD_SCALABLE_UI_V2
+	if( AknLayoutUtils::PenEnabled() )
+		{
+		listBox->ConstructL( popup, EAknListBoxStylusMultiselectionList );
+		}
+	else
+		{
+		listBox->ConstructL( popup, EAknListBoxMultiselectionList );
+		}
+#else
+	listBox->ConstructL( popup, EAknListBoxMultiselectionList );
+#endif
+
+	listBox->CreateScrollBarFrameL(ETrue);
+	listBox->ScrollBarFrame()->
+		SetScrollBarVisibilityL(
+		 CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
+
+	popup->SetIconsL();
+
+	// create model
+    CDesCArrayFlat* items = new (ELeave)CDesCArrayFlat( KArrayGranularity );
+
+	// populate model
+	CleanupStack::PushL(items);
+	CProfileAiwProvider::PopulateListBoxL( items );
+	CleanupStack::Pop(items);
+
+	CTextListBoxModel* model = listBox->Model();
+    model->SetItemTextArray(items);
+
+	// set all items as selected
+	TInt count( listBox->Model()->NumberOfItems() );
+	for( TInt index( 0 ); index < count; index++ )
+		{
+		listBox->View()->SelectItemL( index );
+		}
+
+	TBool changeAllProfiles( EFalse );
+
+    // launch popup
+    iPopup = popup;
+    TInt res = popup->ExecuteLD();
+   	// No leaving functions allowed between executeLD and CleanupStack::Pop().
+    CleanupStack::Pop( popup );
+    iPopup = NULL;
+
+    if( res )
+    	{
+    	iSelectionArray = listBox->View()->SelectionIndexes();
+    	if( count == iSelectionArray->Count() )
+    		{
+    		// User has selected to change all profiles
+    		changeAllProfiles = ETrue;
+    		}
+	   	CProfileAiwProvider::PerformProfileChangeL( aFileName, changeAllProfiles );
+    	}
+    CleanupStack::PopAndDestroy(); // listBox
+	}
+
+// -----------------------------------------------------------------------------
+// CProfileAiwProvider::PopulateListBoxL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileAiwProvider::PopulateListBoxL( CDesCArrayFlat* aItems )
+	{
+	// iEngineHandler must be instantiated each time to make sure
+	// profile list is up to date
+	delete iEngineHandler;
+	iEngineHandler = NULL;
+    iEngineHandler = CProfileEngineHandler::NewL();
+	
+	MProfilesNamesArray* array = iEngineHandler->IdArray();
+	MProfileEngineExtended* engine = iEngineHandler->Engine();
+
+    // Create the mapping array so that the IDs can be mapped to Profile IDs
+    // after the selection has been made
+    // Delete it first in case we're called several times (in the same instance)
+    delete iIndexToIdArray;
+    iIndexToIdArray = NULL;
+    iIndexToIdArray = new ( ELeave ) CArrayFixFlat<TInt>( array->MdcaCount() );
+
+	// Add items
+    TInt count( array->MdcaCount() );
+	TBuf<PROFILES_MAX_NAME_LENGTH + 3> name; // + 3 for icon and tab characters
+	for( TInt index( 0 ); index < count; index++ )
+    	{
+        const MProfileName* profileName = array->ProfileName( index );
+        if( !profileName ) 
+            {
+            continue;
+            }
+
+        TInt profileId( profileName->Id() );
+        // Only the profiles which modifiable flag of ringing tone item is
+        // enabled should be included in the list. In Off-line profile case also
+        // VoIP and WLAN must be supported (otherwise there wouldn't be need for
+        // ringing tone in Off-line profile)
+        if( ( profileId != EProfileOffLineId ) ||
+            ( FeatureManager::FeatureSupported( KFeatureIdCommonVoip ) &&
+              FeatureManager::FeatureSupported( KFeatureIdProtocolWlan ) ) )
+            {
+            MProfileExtended* profile( engine->ProfileLC( profileId ) );
+            TUint32 modFlags( profile->ModifiableFlags() );
+            CleanupStack::PopAndDestroy(); // profile
+            // Only the profiles which ringing tone item is modifiable should
+            // be included in the list
+            if( modFlags & EProfileFlagRingingTone )
+                {
+                name.Copy( KProfileAIWProviderIconAndTab );
+                TBuf< KProfileAiwProviderMaxNameLength >
+                    tmpName( array->MdcaPoint( index ) );
+                AknTextUtils::ReplaceCharacters( tmpName,
+                                                 KAknReplaceListControlChars,
+                                                 TChar( ' ' ) );
+                name.Append( tmpName );
+                aItems->AppendL( name );
+                iIndexToIdArray->AppendL( profileId );
+                }
+            }
+        }
+    iIndexToIdArray->Compress();
+	}
+
+// -----------------------------------------------------------------------------
+// CProfileAiwProvider::InitializeMenuPaneL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileAiwProvider::InitializeMenuPaneL( CAiwMenuPane& aMenuPane,
+                                             TInt aIndex,
+                                             TInt /*aCascadeId*/,
+                                             const CAiwGenericParamList& aInParamList )
+    {
+    TResourceReader reader;
+    CCoeEnv::Static()->CreateResourceReaderLC( reader,
+                                               R_PROFILEAIWPROVIDER_MENU );
+
+ 	// Retrieve filename and file MIME type from AIW param list
+	TPtrC mimeTypeString = CProfileAiwProvider::GetAiwParamAsDescriptor
+		(aInParamList, EGenericParamMIMEType);
+
+	if( CProfileAiwProvider::CheckMimeTypeL( mimeTypeString ) )
+		{
+		// Only add menuitem if MIME type is valid
+		aMenuPane.AddMenuItemsL( reader, KAiwCmdAssign, aIndex );
+		}
+
+    CleanupStack::PopAndDestroy(); // reader
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileAiwProvider::HandleMenuCmdL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+void CProfileAiwProvider::HandleMenuCmdL( TInt aMenuCmdId,
+                                        const CAiwGenericParamList& aInParamList,
+                                        CAiwGenericParamList& aOutParamList,
+                                        TUint aCmdOptions,
+                                        const MAiwNotifyCallback* aCallback )
+    {
+    // Route to HandleServiceCmdL
+    HandleServiceCmdL(aMenuCmdId, aInParamList,
+        aOutParamList, aCmdOptions, aCallback);
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileAiwProvider::GetAiwParamAsDescriptor
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TPtrC CProfileAiwProvider::GetAiwParamAsDescriptor(
+		const CAiwGenericParamList& aParamList,
+		TGenericParamId aParamType)
+	{
+	TInt index = 0;
+	const TAiwGenericParam* genericParam = NULL;
+    genericParam = aParamList.FindFirst(
+        index,
+        aParamType,
+        EVariantTypeDesC);
+
+    if (index >= 0 && genericParam)
+        {
+        // Get the data
+        return genericParam->Value().AsDes();
+        }
+	else
+    	{
+		return KNullDesC();
+    	}
+	}
+
+// -----------------------------------------------------------------------------
+// CProfileAiwProvider::CheckMimeTypeL
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+TBool CProfileAiwProvider::CheckMimeTypeL(const TDesC& aMimeTypeString)
+    {
+    if( ( aMimeTypeString.MatchF( KAudioCommonMimeType ) == 0 ) ||
+		( aMimeTypeString.CompareF( KAudioRngMimeType ) == 0 ) )
+    	{
+    	iIsVideo = EFalse;
+    	return ETrue;
+    	}
+
+#ifdef RD_VIDEO_AS_RINGING_TONE	
+    if( aMimeTypeString.MatchF( KVideoCommonMimeType ) == 0 ||
+		aMimeTypeString.CompareF( KRMVideoMimeType ) == 0 ||
+		aMimeTypeString.CompareF( KRMVideoMimeType2 ) == 0 ||
+		aMimeTypeString.CompareF( KSDPVideoMimeType ) == 0 )
+        {
+        iIsVideo = ETrue;
+		return ETrue;
+        }
+#endif
+
+	return EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileAiwProvider::IsToneFileSizeOkL
+// -----------------------------------------------------------------------------
+//
+TBool CProfileAiwProvider::IsToneFileSizeOkL( const TDesC& aFile )
+    {
+    if( !iMaxSize )
+        { // no limit set -> every tone will be ok (what comes to size):
+        return ETrue;
+        }
+
+    // Get file size
+    TInt size = 0;
+    TBool result( ETrue );
+
+    TEntry entry;
+    if ( CCoeEnv::Static()->FsSession().Entry( aFile, entry ) == KErrNone )
+        {
+        size = entry.iSize;        
+        }
+
+	// Check. NOTE: now if file size couldn't be determined, check fails.
+	if ( size > (iMaxSize*KKilo) )
+		{
+        result = EFalse;
+		}
+
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileAiwProvider::ShowErrorNoteL
+// -----------------------------------------------------------------------------
+//
+void CProfileAiwProvider::ShowErrorNoteL( const TDesC& aErrorText ) const
+    {
+    CAknInformationNote* note = new( ELeave ) CAknInformationNote( EFalse );
+    note->ExecuteLD( aErrorText );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfileAiwProvider::CopyIfRemoteL
+// -----------------------------------------------------------------------------
+//
+TBool CProfileAiwProvider::CopyIfRemoteL( const TDesC& aFileName, TFileName& aTarget ) const
+    {
+    TBool remote( EFalse );
+	TParsePtrC parsedName( aFileName );
+	RFs& fsSession( CCoeEnv::Static()->FsSession() );
+    TDriveUnit driveUnit( parsedName.Drive() );
+	TUint driveStatus( 0 );
+
+	DriveInfo::GetDriveStatus( fsSession, driveUnit, driveStatus );
+	remote = ( ( driveStatus & DriveInfo::EDriveRemote ) == DriveInfo::EDriveRemote );
+
+	if( remote )
+		{
+		// If the tone is on a remote drive, it must be copied
+		aTarget.Insert( 0, parsedName.NameAndExt() );
+		if( iIsVideo )
+			{
+			aTarget.Insert( 0, PathInfo::VideosPath() );
+			}
+		else
+			{
+			aTarget.Insert( 0, PathInfo::SoundsPath() );
+			}
+		aTarget.Insert( 0, PathInfo::PhoneMemoryRootPath() );
+		User::LeaveIfError( EikFileUtils::CopyFile( aFileName, aTarget ) );
+		}
+
+	return remote;
+    }
+
+
+// -----------------------------------------------------------------------------
+//
+// 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
+
+// -----------------------------------------------------------------------------
+// CProfileAiwProvider::IsFileWMDRMProtectedL
+// -----------------------------------------------------------------------------
+//
+TBool CProfileAiwProvider::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/profilesapplication/Profiles/ProfileAiwProvider/src/CProfileAiwProvider.h	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,216 @@
+/*
+* 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 Aiw service provider.
+*
+*/
+
+
+#ifndef __CPROFILEAIWPROVIDER_H__
+#define __CPROFILEAIWPROVIDER_H__
+
+// INTERNAL INCLUDES
+
+// EXTERNAL INCLUDES
+#include <AiwServiceIfMenu.h>
+
+// FORWARD DECLARATIONS
+class CProfileToneHandler;
+class CProfileEngineHandler;
+class CAknPopupList;
+
+// CLASS DECLARATION
+
+/**
+*  Profiles AIW Provider
+*  AIW Provider for seting files as ringingtone
+*
+*  @lib ProfileSettingsView.lib
+*  @since 3.1
+*/
+
+NONSHARABLE_CLASS( CProfileAiwProvider )
+ : public CAiwServiceIfMenu
+    {
+    public: // Constructors and destructors
+    
+    	/**
+         * Two-phase static constructor
+         * @return A pointer to a fully constructed CProfileAiwProvider instance
+         */
+        static CProfileAiwProvider* NewL();
+        
+        /**
+         * Destructor
+         */
+        virtual ~CProfileAiwProvider();
+
+    private: // From CAiwServiceIfMenu
+
+        void InitialiseL( MAiwNotifyCallback& aFrameworkCallback,
+                          const RCriteriaArray& aInterest );
+
+        void HandleServiceCmdL( const TInt& aCmdId,
+                                const CAiwGenericParamList& aInParamList,
+                                CAiwGenericParamList& aOutParamList,
+                                TUint aCmdOptions = 0,
+                                const MAiwNotifyCallback* aCallback = NULL );
+
+        void InitializeMenuPaneL( CAiwMenuPane& aMenuPane,
+                                  TInt aIndex,
+                                  TInt aCascadeId,
+                                  const CAiwGenericParamList& aInParamList );
+
+        void HandleMenuCmdL( TInt aMenuCmdId,
+                             const CAiwGenericParamList& aInParamList,
+                             CAiwGenericParamList& aOutParamList,
+                             TUint aCmdOptions = 0,
+                             const MAiwNotifyCallback* aCallback = NULL );
+
+    private: // Constructors and destructors
+        
+        /**
+         * Constructor
+         */
+        CProfileAiwProvider();
+      	
+      	/**
+         * Second phase constructor
+         */
+        void ConstructL();
+
+	private:	// New functions
+		
+       /*
+       * Reads AIW parameters
+       * @param aParamList Generic parameterlist
+       * @param aParamType Generic parameterID
+       * @return Parameter in text form
+       */
+        TPtrC GetAiwParamAsDescriptor(
+        	const CAiwGenericParamList& aParamList,
+        	 TGenericParamId aParamType);
+		/*
+       * Checks MIME type 
+       * @param aMimeTypeString MIME type to be checked
+       * @return Returns ETrue if MIME type is valid ( audio or video )
+       */
+       TBool CheckMimeTypeL(const TDesC& aMimeTypeString);
+       
+       /*
+        * Launches multiselection popup listbox containing profile names
+        * @param aPopupTitle Listbox title
+        * @param aFilename Filename to be assigned as ringing tone
+       	*/
+		void LaunchL( const TDesC& aPopupTitle, const TDesC& aFileName );   
+		/*
+		* Populates listbox
+		* @param aItems Pointer to constructed listbox item array
+       	*/
+		void PopulateListBoxL( CDesCArrayFlat* aItems );
+		/*
+		* Performs the setting of ringing tone through ProfileSettingsView API
+		* @param aFileName Filename to be assigned as ringing tone
+		* @param aChangeAllProfiles Boolean value defines whether all 
+		* profiles are changed
+       	*/
+		void PerformProfileChangeL(
+		 const TDesC& aFileName, const TBool& aChangeAllProfiles ) const;
+
+        /**
+         * Checks that the size of the tone file does not exceed the set limit
+         * (if one has been set).
+         * @param aFileName the name of the file to be assigned as ringing tone
+         * @return ETrue if the size of the file does not rule the file out to
+         * be set as ringing tone
+         */
+        TBool IsToneFileSizeOkL( const TDesC& aFile );
+
+		/**
+         * Displays an error note.
+         * @param aResourceId Resource ID to a TBUF resource.
+         */
+        void ShowErrorNoteL( const TDesC& aErrorText ) 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;
+
+		/**
+         * Checks if file is located on a remote drive and copies it if so.
+         * @param aFileName Name of the file to be checked/copied.
+         * @param aTarget File name on device after copying.
+         * @return ETrue if file is remote, EFalse otherwise.
+         */
+		TBool CopyIfRemoteL( const TDesC& aFileName, TFileName& aTarget ) const;
+
+    private: // Data
+
+		/// Own: Profile tone handler
+		CProfileToneHandler* iProfileToneHandler;
+		
+		/// Own: Engine handler.
+        CProfileEngineHandler* iEngineHandler;
+		
+      	/// Ref: AIWCallback
+        MAiwNotifyCallback* iConstNotifyCallback;
+        
+        /// Own: WMA Error text
+        HBufC* iWMAErrorText;
+        
+        /// Own: MP4 Error text
+		HBufC* iMP4ErrorText;
+        
+        /// Own: Unprotected Error text
+		HBufC* iUnprotectedErrorText;
+		
+		/// Own: Not supported Error text
+		HBufC* iNotSupportedErrorText;
+		
+		/// Own: Popup
+		CAknPopupList* iPopup;
+
+		/// Own: Popup title text
+		HBufC* iPopupTitle;
+		
+		/// Own: Changed profile information text
+		HBufC* iChangedProfilesText;
+		
+		/// Own: File was copied and set
+		HBufC* iCopiedAndChangedText;
+
+		/// Own: Tone file size too big error text
+		HBufC* iSizeErrorText;
+		
+		/// Own: ListBox selection array
+		const CArrayFix<TInt>* iSelectionArray;
+		
+		/// Own: Array for mapping of original indexes in Profile name array
+        /// to Profile IDs
+		CArrayFixFlat<TInt>* iIndexToIdArray;
+		
+        /// Resource offset
+        TInt iResourceOffset;
+     
+        /// Maximum allowed size for tone files:
+        TInt iMaxSize;
+        
+        /// Is file video:
+        TBool iIsVideo;
+     
+    };
+
+#endif // __CPROFILEAIWPROVIDER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileAiwProvider/src/Dllmain.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,39 @@
+/*
+* 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 Aiw application gets instantiated starting from this class.
+*
+*/
+
+
+// INTERNAL INCLUDES
+#include "ProfileAiwProviderUid.h"
+#include "CProfileAiwProvider.h"
+
+// EXTERNAL INCLUDES
+#include <e32std.h>
+#include <implementationproxy.h>
+
+// Define the interface UIDs
+const TImplementationProxy ImplementationTable[] =
+    {
+    IMPLEMENTATION_PROXY_ENTRY( KProfileAiwProviderImplUid, CProfileAiwProvider::NewL )
+    };
+
+// The one and only exported function that is the ECom entry point
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
+    {
+    aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy );
+
+    return ImplementationTable;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/BWINS/PROFILESETTINGSVIEWU.DEF	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,27 @@
+EXPORTS
+	?AllowedToChange@CProfileSettingsContainer@@QBEHH@Z @ 1 NONAME ; int CProfileSettingsContainer::AllowedToChange(int) const
+	?CurrentProfileIndex@CProfileIndexHandler@@QBEHXZ @ 2 NONAME ; int CProfileIndexHandler::CurrentProfileIndex(void) const
+	?EditItemL@CProfileSettingsContainer@@UAEXHH@Z @ 3 NONAME ; void CProfileSettingsContainer::EditItemL(int, int)
+	?Engine@CProfileEngineHandler@@QBEPAVMProfileEngineExtended@@XZ @ 4 NONAME ; class MProfileEngineExtended * CProfileEngineHandler::Engine(void) const
+	?IdArray@CProfileEngineHandler@@QBEPAVMProfilesNamesArray@@XZ @ 5 NONAME ; class MProfilesNamesArray * CProfileEngineHandler::IdArray(void) const
+	?IdForIndex@CProfileEngineHandler@@QBEHH@Z @ 6 NONAME ; int CProfileEngineHandler::IdForIndex(int) const
+	?NewL@CProfileEngineHandler@@SAPAV1@XZ @ 7 NONAME ; class CProfileEngineHandler * CProfileEngineHandler::NewL(void)
+	?NewL@CProfileIndexHandler@@SAPAV1@AAVCProfileEngineHandler@@@Z @ 8 NONAME ; class CProfileIndexHandler * CProfileIndexHandler::NewL(class CProfileEngineHandler &)
+	?NewL@CProfileSettingsContainer@@SAPAV1@AAVCAknView@@AAVCProfileEngineHandler@@PAVCProfileIndexHandler@@PAVCProfileTabHandler@@PAVCAknTitlePane@@@Z @ 9 NONAME ; class CProfileSettingsContainer * CProfileSettingsContainer::NewL(class CAknView &, class CProfileEngineHandler &, class CProfileIndexHandler *, class CProfileTabHandler *, class CAknTitlePane *)
+	?NewL@CProfileTabHandler@@SAPAV1@AAVCProfileEngineHandler@@AAVCProfileIndexHandler@@AAVCAknNavigationControlContainer@@@Z @ 10 NONAME ; class CProfileTabHandler * CProfileTabHandler::NewL(class CProfileEngineHandler &, class CProfileIndexHandler &, class CAknNavigationControlContainer &)
+	?NewL@CProfileToneHandler@@SAPAV1@XZ @ 11 NONAME ; class CProfileToneHandler * CProfileToneHandler::NewL(void)
+	?NewLC@CProfileToneHandler@@SAPAV1@XZ @ 12 NONAME ; class CProfileToneHandler * CProfileToneHandler::NewLC(void)
+	?ReadIdArrayL@CProfileEngineHandler@@QAEXXZ @ 13 NONAME ; void CProfileEngineHandler::ReadIdArrayL(void)
+	?SetActiveProfileRingingToneL@CProfileToneHandler@@QAEHABVTDesC16@@@Z @ 14 NONAME ; int CProfileToneHandler::SetActiveProfileRingingToneL(class TDesC16 const &)
+	?SetCurrentProfileIndex@CProfileIndexHandler@@QAEXH@Z @ 15 NONAME ; void CProfileIndexHandler::SetCurrentProfileIndex(int)
+	?SetProfileToneL@CProfileToneHandler@@QAEHHW4TProfileTones@@ABVTDesC16@@@Z @ 16 NONAME ; int CProfileToneHandler::SetProfileToneL(int, enum TProfileTones, class TDesC16 const &)
+	?SetToneForAllProfilesL@CProfileToneHandler@@QAEHW4TProfileTones@@ABVTDesC16@@@Z @ 17 NONAME ; int CProfileToneHandler::SetToneForAllProfilesL(enum TProfileTones, class TDesC16 const &)
+	?TabGroup@CProfileTabHandler@@QBEPAVCAknTabGroup@@XZ @ 18 NONAME ; class CAknTabGroup * CProfileTabHandler::TabGroup(void) const
+	?NewL@CProfileSettingsContainer@@SAPAV1@AAVMProfileViewHandler@@AAVCProfileEngineHandler@@AAVMProfileExternalSettingsHandler@@PAVCProfileIndexHandler@@PAVCProfileTabHandler@@PAVCAknTitlePane@@@Z @ 19 NONAME ; class CProfileSettingsContainer * CProfileSettingsContainer::NewL(class MProfileViewHandler &, class CProfileEngineHandler &, class MProfileExternalSettingsHandler &, class CProfileIndexHandler *, class CProfileTabHandler *, class CAknTitlePane *)
+	?NewL@CProfileSettingsContainer@@SAPAV1@AAVMProfileViewHandler@@AAVCProfileEngineHandler@@AAVMProfileExternalSettingsHandler@@PAVCProfileIndexHandler@@PAVCProfileTabHandler@@PAVCAknTitlePane@@H@Z @ 20 NONAME ; class CProfileSettingsContainer * CProfileSettingsContainer::NewL(class MProfileViewHandler &, class CProfileEngineHandler &, class MProfileExternalSettingsHandler &, class CProfileIndexHandler *, class CProfileTabHandler *, class CAknTitlePane *, int)
+	?ItemEdited@CProfileSettingsContainer@@QBEHXZ @ 21 NONAME ; int CProfileSettingsContainer::ItemEdited(void) const
+	?SetProfileToneNotCheckL@CProfileToneHandler@@QAEHHW4TProfileTones@@ABVTDesC16@@@Z @ 22 NONAME ; int CProfileToneHandler::SetProfileToneNotCheckL(int, enum TProfileTones, class TDesC16 const &)
+	?SetNaviPaneTextL@CProfileNaviPaneContainer@@QAEXABVTDesC16@@@Z @ 23 NONAME ; void CProfileNaviPaneContainer::SetNaviPaneTextL(class TDesC16 const &)
+	?SetNaviPaneTextL@CProfileNaviPaneContainer@@QAEXXZ @ 24 NONAME ; void CProfileNaviPaneContainer::SetNaviPaneTextL(void)
+	?NewL@CProfileNaviPaneContainer@@SAPAV1@AAVCEikStatusPane@@AAVCProfileEngineHandler@@@Z @ 25 NONAME ; class CProfileNaviPaneContainer * CProfileNaviPaneContainer::NewL(class CEikStatusPane &, class CProfileEngineHandler &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/EABI/ProfileSettingsViewU.DEF	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,39 @@
+EXPORTS
+	_ZN18CProfileTabHandler4NewLER21CProfileEngineHandlerR20CProfileIndexHandlerR30CAknNavigationControlContainer @ 1 NONAME
+	_ZN19CProfileToneHandler15SetProfileToneLEi13TProfileTonesRK7TDesC16 @ 2 NONAME
+	_ZN19CProfileToneHandler22SetToneForAllProfilesLE13TProfileTonesRK7TDesC16 @ 3 NONAME
+	_ZN19CProfileToneHandler28SetActiveProfileRingingToneLERK7TDesC16 @ 4 NONAME
+	_ZN19CProfileToneHandler4NewLEv @ 5 NONAME
+	_ZN19CProfileToneHandler5NewLCEv @ 6 NONAME
+	_ZN20CProfileIndexHandler22SetCurrentProfileIndexEi @ 7 NONAME
+	_ZN20CProfileIndexHandler4NewLER21CProfileEngineHandler @ 8 NONAME
+	_ZN21CProfileEngineHandler12ReadIdArrayLEv @ 9 NONAME
+	_ZN21CProfileEngineHandler4NewLEv @ 10 NONAME
+	_ZN25CProfileSettingsContainer4NewLER8CAknViewR21CProfileEngineHandlerP20CProfileIndexHandlerP18CProfileTabHandlerP13CAknTitlePane @ 11 NONAME
+	_ZN25CProfileSettingsContainer9EditItemLEii @ 12 NONAME
+	_ZNK18CProfileTabHandler8TabGroupEv @ 13 NONAME
+	_ZNK20CProfileIndexHandler19CurrentProfileIndexEv @ 14 NONAME
+	_ZNK21CProfileEngineHandler10IdForIndexEi @ 15 NONAME
+	_ZNK21CProfileEngineHandler6EngineEv @ 16 NONAME
+	_ZNK21CProfileEngineHandler7IdArrayEv @ 17 NONAME
+	_ZNK25CProfileSettingsContainer15AllowedToChangeEi @ 18 NONAME
+	_ZTI18CProfileTabHandler @ 19 NONAME ; #<TI>#
+	_ZTI19CProfileToneHandler @ 20 NONAME ; #<TI>#
+	_ZTI20CProfileIndexHandler @ 21 NONAME ; #<TI>#
+	_ZTI21CProfileEngineHandler @ 22 NONAME ; #<TI>#
+	_ZTI25CProfileSettingsContainer @ 23 NONAME ; #<TI>#
+	_ZTI31CProfileKeypadVolumeSettingPage @ 24 NONAME ; #<TI>#
+	_ZTV18CProfileTabHandler @ 25 NONAME ; #<VT>#
+	_ZTV19CProfileToneHandler @ 26 NONAME ; #<VT>#
+	_ZTV20CProfileIndexHandler @ 27 NONAME ; #<VT>#
+	_ZTV21CProfileEngineHandler @ 28 NONAME ; #<VT>#
+	_ZTV25CProfileSettingsContainer @ 29 NONAME ; #<VT>#
+	_ZTV31CProfileKeypadVolumeSettingPage @ 30 NONAME ; #<VT>#
+	_ZN25CProfileSettingsContainer4NewLER19MProfileViewHandlerR21CProfileEngineHandlerR31MProfileExternalSettingsHandlerP20CProfileIndexHandlerP18CProfileTabHandlerP13CAknTitlePane @ 31 NONAME
+	_ZN25CProfileSettingsContainer4NewLER19MProfileViewHandlerR21CProfileEngineHandlerR31MProfileExternalSettingsHandlerP20CProfileIndexHandlerP18CProfileTabHandlerP13CAknTitlePanei @ 32 NONAME
+	_ZNK25CProfileSettingsContainer10ItemEditedEv @ 33 NONAME
+	_ZN19CProfileToneHandler23SetProfileToneNotCheckLEi13TProfileTonesRK7TDesC16 @ 34 NONAME
+	_ZN25CProfileNaviPaneContainer16SetNaviPaneTextLERK7TDesC16 @ 35 NONAME
+	_ZN25CProfileNaviPaneContainer16SetNaviPaneTextLEv @ 36 NONAME
+	_ZN25CProfileNaviPaneContainer4NewLER14CEikStatusPaneR21CProfileEngineHandler @ 37 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewInc/CProfileEngineHandler.h	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  Profile engine handler
+*
+*/
+
+
+
+#ifndef CPROFILEENGINEHANDLER_H
+#define CPROFILEENGINEHANDLER_H
+
+//  INCLUDES
+#include <e32base.h>
+
+//  FORWARD DECLARATIONS
+class MProfileEngineExtended;
+class MProfilesNamesArray;
+
+//  CLASS DECLARATION
+
+/**
+*  Profile Engine Handler.
+*  Keeps an instance of Profile Engine and maintains a list of profile names.
+*
+*  @lib ProfileSettingsView.lib
+*  @since 2.5
+*/
+class CProfileEngineHandler : public CBase
+    {
+    public:     // Constructors and destructor
+
+        /**
+        * Symbian 2-phase constructor.
+        * @return Returns an instance of CProfileEngineHandler.
+        */
+        IMPORT_C static CProfileEngineHandler* NewL();
+
+        // Destructor.
+        ~CProfileEngineHandler();
+
+    public:     // New methods
+
+        /**
+        * Returns pointer to Profile Engine extended interface.
+        * @return Returns pointer to Profile Engine extended interface.
+        */
+        IMPORT_C MProfileEngineExtended* Engine() const;
+
+        /**
+        * Reads an array of profile IDs from Profile Engine.
+        */
+        IMPORT_C void ReadIdArrayL();
+
+        /**
+        * Returns an array of profile names and IDs.
+        * @return Returns an array of profile names and IDs.
+        */
+        IMPORT_C MProfilesNamesArray* IdArray() const;
+
+        /**
+        * Returns the ID of a profile at index in iProfileIdArray
+        * @param aIndex Index of the profile.
+        * @return Returns ID of the profile.
+        */
+        IMPORT_C TInt IdForIndex( TInt aIndex ) const;
+
+    protected:
+
+        // C++ default constructor.
+        CProfileEngineHandler();
+
+        // Symbian 2nd phase construct.
+        void ConstructL();
+
+    private:    // Data
+
+        // Own: Profile engine extended instance.
+        MProfileEngineExtended* iEngine;
+
+        // Own: Array of profile names and IDs.
+        MProfilesNamesArray* iIdArray;
+
+    };
+
+#endif // CPROFILEENGINEHANDLER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewInc/CProfileIndexHandler.h	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,167 @@
+/*
+* 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 index handler (for use of Settings Container
+*                if multiple profiles are edited)
+*
+*/
+
+
+#ifndef CPROFILEINDEXHANDLER_H
+#define CPROFILEINDEXHANDLER_H
+
+//  INCLUDES
+#include <e32base.h>
+
+//  FORWARD DECLARATIONS
+class CProfileEngineHandler;
+class CEikListBox;
+
+//  CLASS DECLARATION
+
+/**
+*  Profile index handler.
+*  For use of Settings Container if multiple profiles are edited.
+*
+*  @lib ProfileSettingsView.lib
+*  @since 2.5
+*/
+class CProfileIndexHandler : public CBase
+    {
+    public:
+
+        /**
+        * Symbian 2-phase constructor.
+        * @param aEngineHandler An instance of Engine Handler.
+        * @return Returns an instance of CProfileIndexHandler.
+        */
+        IMPORT_C static CProfileIndexHandler* NewL(
+            CProfileEngineHandler& aEngineHandler );
+
+        // Destructor
+        ~CProfileIndexHandler();
+
+    public:     // New methods
+
+        /**
+        * Returns the index of current profile.
+        * @return Returns the index of current profile.
+        */
+        IMPORT_C TInt CurrentProfileIndex() const;
+
+        /**
+        * Sets the index of current profile.
+        * @param aIndex The index of the new current profile.
+        */
+        IMPORT_C void SetCurrentProfileIndex( TInt aIndex );
+
+        /**
+        * Creates the index array.
+        */
+        void CreateIndexArrayL();
+
+        /**
+        * Stores current indices (top item index and current item index).
+        */
+        void StoreIndices();
+
+        /**
+        * Loads previous indices.
+        */
+        void LoadIndices();
+
+        /**
+        * Indexes the index array.
+        * @param aIndex Index of the item index.
+        * @return Returns item index at index.
+        */
+        TInt IndexAt( TInt aIndex ) const;
+
+        /**
+        * Indexes the top index array.
+        * @param aIndex Index of the top item index.
+        * @return Returns top item index at index.
+        */
+        TInt TopIndexAt( TInt aIndex ) const;
+
+        /**
+        * Removes items from the index arrays and inserts a new ones.
+        * @param aOldIndex Index of the old items to be removed.
+        * @param aNewIndex Index of the new items to be added.
+        * @param aIndexValue Value of the new item index.
+        * @param aTopIndexValue Value of the new top item index.
+        * @return Returns KErrNotFound if the old index is not found,
+        *         KErrArgument if the new index is out of bounds,
+        *         KErrNone if no errors.
+        */
+        TInt RemoveAndInsert(
+            TInt aOldIndex, TInt aNewIndex,
+            TInt aIndexValue, TInt aTopIndexValue );
+
+        /**
+        * Sets a list box pointer so indices can be stored and loaded.
+        * @param aListBox The List box pointer.
+        *        Remember to set back to NULL when listbox is deleted!
+        */
+        void SetListBox( CEikListBox* aListBox );
+
+        /**
+        * Calls Engine Handler's ReadIdArrayL and re-arranges index array.
+        * @return Returns the index of the edited profile after re-arrange.
+        */
+        TInt ReadIdArrayAndUpdateL();
+
+    protected:
+
+        /**
+        * C++ constuctor.
+        * @param aEngineHandler An instance of Engine Handler.
+        */
+        CProfileIndexHandler(
+            CProfileEngineHandler& aEngineHandler );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private:    // Data
+
+        // Profile Engine handler.
+        CProfileEngineHandler& iEngineHandler;
+
+		// Index of the currently focused profile.
+		TInt iCurrentProfileIndex;
+
+        // Ref: Listbox pointer to load and store top item and current item indices.
+        CEikListBox* iListBox;
+
+        // Struct for one index
+        struct TItem
+            {
+            // Current item index in listbox
+            TInt iIndex;
+	        // Top item index in listbox
+	        // Value 0 means that the focused item is the first in view,
+	        // 1 means that it's the second and 2 the last.
+            TInt iTopIndex;
+            };
+
+		// Array of item indices.
+		RArray<TItem> iIndexArray;
+
+    };
+
+#endif // CPROFILEINDEXHANDLER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewInc/CProfileNaviPaneContainer.h	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,105 @@
+/*
+* 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:  Container for navi pane decorator.
+*
+*/
+
+
+
+#ifndef CPROFILENAVIPANECONTAINER_H
+#define CPROFILENAVIPANECONTAINER_H
+
+// INCLUDES
+#include <e32base.h>
+
+// FORWARD DECLARATIONS
+class CEikStatusPane;
+class CProfileEngineHandler;
+class CAknNavigationControlContainer;
+class CAknNavigationDecorator;
+
+// CLASS DECLARATION
+/**
+*  Container for navi pane decorator.
+*
+*  @lib Profileapp.app
+*  @since 2.5
+*/
+NONSHARABLE_CLASS( CProfileNaviPaneContainer ) : public CBase
+    {
+    public:     // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        * @param aStatusPane An instance of status pane.
+        * @param aEngineHandler An instance of Engine Handler.
+        * @return Returns an instance of CProfileNaviPaneContainer
+        */
+        IMPORT_C static CProfileNaviPaneContainer* NewL(
+            CEikStatusPane& aStatusPane,
+            CProfileEngineHandler& aEngineHandler );
+
+        /**
+        * Destructor.
+        */
+        ~CProfileNaviPaneContainer();
+
+    public:    // New functions
+
+        /**
+        * Sets navi pane text.
+        * @param aText Navi pane text.
+        */
+        IMPORT_C void SetNaviPaneTextL( const TDesC& aText );
+
+        /**
+        * Sets active profile name as navi pane text.
+        */
+        IMPORT_C void SetNaviPaneTextL();
+
+    private:
+
+        /**
+        * C++ constructor.
+        * @param aEngineHandler An instance of Engine Handler.
+        */
+        CProfileNaviPaneContainer( CProfileEngineHandler& aEngineHandler );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        * @param aStatusPane An instance of status pane.
+        */
+        void ConstructL( CEikStatusPane& aStatusPane );
+        
+    private:	// New functions
+    	void Release();
+
+    private:    // Data
+
+        // Profile Engine Handler.
+        CProfileEngineHandler& iEngineHandler;
+
+        // Ref: Pointer to navi pane
+        CAknNavigationControlContainer* iNaviPane;
+
+        // Own: Navigation decorator.
+        CAknNavigationDecorator* iNaviDecorator;
+
+    };
+
+
+#endif // CPROFILENAVIPANECONTAINER_H
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewInc/CProfileSettingsContainer.h	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,418 @@
+/*
+* 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:  Container class of settings view.
+*
+*/
+
+
+#ifndef CPROFILESETTINGSCONTAINER_H
+#define CPROFILESETTINGSCONTAINER_H
+
+// INCLUDES
+#include    <aknsettingitemlist.h>      // CAknSettingItemList
+#include    <MSSSettingsObserver.h>
+#include    <ConeResLoader.h>           // RConeResourceLoader
+#include    <AknTabObserver.h>          // MAknTabObserver
+#include    <MProfileChangeObserver.h>
+#include    "MProfileExternalSettingsObserver.h"
+#include    "MProfileExternalSettingsHandler.h"
+#include    <centralrepository.h>
+#include    <cenrepnotifyhandler.h>
+
+// FORWARD DECLARATIONS
+class MProfileViewHandler;
+class CAknTitlePane;
+class CProfileEngineHandler;
+class CProfileIndexHandler;
+class CProfileTabHandler;
+class MProfileExtended;
+class CProfileStruct;
+class CAknKeySoundSystem;
+class CProfileChangeNotifyHandler;
+class MProfilesLocalFeatures;
+class CProfileSettingsView;
+class CAknView;
+class CRepository;
+class CCenRepNotifyHandler;
+class CProfileNaviPaneContainer;
+
+// CLASS DECLARATION
+/**
+*  Container class of settings view.
+*  Inherited from...
+*  MSSSettingsObserver
+*      to receive notifications of changes in Alternate Line Service setting.
+*  MAknTabObserver
+*      to receive notifications if tabs are changed.
+*  MProfileChangeObserver
+*      to receive notification when the active profile changes.
+*
+*  @lib ProfileSettingsView.lib
+*  @since 1.2
+*/
+class CProfileSettingsContainer : public CAknSettingItemList,
+                                  public MSSSettingsObserver,
+                                  public MAknTabObserver,
+                                  public MProfileChangeObserver,
+                                  public MProfileExternalSettingsObserver,
+                                  public MCenRepNotifyHandlerCallback
+    {
+    public:     // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        * Note, this constructor has been deprecated and should not be used.
+        * @return always NULL.
+        */
+        IMPORT_C static CProfileSettingsContainer* NewL(
+            CAknView& aAknView,
+            CProfileEngineHandler& aEngineHandler,
+            CProfileIndexHandler* aIndexHandler,
+            CProfileTabHandler* aTabHandler,
+            CAknTitlePane* aTitlePane );
+
+        /**
+        * Two-phased constructor.
+        * @param aAknView Parent view to get ClientRect and set MopParent.
+        * @param aEngineHandler Engine handler to access Profile Engine.
+        * @param aExternalSettingsHandler handler class for those settings that
+        *        are saved outside of Profiles.
+        * @param aIndexHandler Index handler for supporting several profiles
+        *        in view functionality. Can be NULL.
+        * @param aTabHandler Tab handler for supporting tab functionality
+        *        in Settings view. Can be NULL.
+        * @param aTitlePane Title pane access for setting title pane text.
+        *        Can be NULL.
+        */
+        IMPORT_C static CProfileSettingsContainer* NewL(
+            MProfileViewHandler& aProfileViewHandler,
+            CProfileEngineHandler& aEngineHandler,
+            MProfileExternalSettingsHandler& aExternalSettingsHandler,
+            CProfileIndexHandler* aIndexHandler,
+            CProfileTabHandler* aTabHandler,
+            CAknTitlePane* aTitlePane );
+
+        /**
+        * Two-phased constructor.
+        * @param aAknView Parent view to get ClientRect and set MopParent.
+        * @param aEngineHandler Engine handler to access Profile Engine.
+        * @param aIndexHandler Index handler for supporting several profiles
+        *        in view functionality. Can be NULL.
+        * @param aTabHandler Tab handler for supporting tab functionality
+        *        in Settings view. Can be NULL.
+        * @param aTitlePane Title pane access for setting title pane text.
+        *        Can be NULL.
+        * @param aResourceId the id of the setting item list resource.
+        */
+        IMPORT_C static CProfileSettingsContainer* NewL(
+            MProfileViewHandler& aProfileViewHandler,
+            CProfileEngineHandler& aEngineHandler,
+            MProfileExternalSettingsHandler& aExternalSettingsHandler,
+            CProfileIndexHandler* aIndexHandler,
+            CProfileTabHandler* aTabHandler,
+            CAknTitlePane* aTitlePane,
+            TInt aResourceId );
+
+        /**
+        * Destructor.
+        */
+        ~CProfileSettingsContainer();
+
+    public:     // New functions
+
+        /**
+        * Tells if information of a setting can be changed.
+        * If EFalse is returned, EditItemL for the setting item in question
+        * should not be called and "Change" should be removed from the Options menu.
+        * @param aSettingItemId The setting item ID.
+        * @return Returns if information of a setting can be changed.
+        */
+        IMPORT_C TBool AllowedToChange( TInt aSettingItemId ) const;
+
+		/**
+		* Runs CheckFileExistenceL (by calling DoFileCheckL)
+        * @param TAny* aObj CProfileSettingContainer pointer
+		* @return 1
+        */
+		static TInt StartFileCheckL( TAny* aObj );
+
+     public:     // Functions from base classes
+
+        /**
+        * From CAknSettingItemList.
+        */
+        IMPORT_C void EditItemL( TInt aIndex, TBool aCalledFromMenu );
+     
+     public:  // from MCentRepNotifyHandlerCallback
+		    /**
+        * @see MCentRepNotifyHandlerCallback.
+        * @param aId Id of the key that has changed.
+        * @param aNewValue The new value of the key.
+        */
+        void HandleNotifyInt(
+            TUint32 aId, TInt aNewValue );
+
+    protected:    // New functions
+
+        /**
+        * Frees resources allocated for profile data.
+        * Remember to maintain class state before calling this method!
+        */
+        void ReleaseProfile();
+
+        /**
+        * Reads profile data from Profile Engine.
+        */
+        void ReadProfileL();
+
+        /**
+        * Hides all setting items that have been set hidden for current profile
+        * ands sets visible all that aren't.
+        */
+        void SetHiddenFlagsL();
+
+        /**
+        * Updates all setting items.
+        * Called when the changed settings must be updated to the UI.
+        * @param aReadProfileSettings if this is ETrue, the profile settings are
+        * read from Profiles Engine.
+        */
+        void UpdateSettingsL( TBool aReadProfileSettings = ETrue );
+
+        /**
+        * Creates a setting item for FileListDialog.
+        * @param aFileName Filename.
+        * @param aIdentifier Setting item identifier.
+        * @return Returns the created setting item object.
+        */
+        CAknSettingItem* CreateFileListSettingItemL(
+            TDes& aFileName, TInt aIdentifier );
+
+        /**
+        * Returns the index of a setting item in setting item array.
+        * @param aId Setting item identifier.
+        * @return Returns the index of a setting item if found, otherwise
+        *         KErrNotFound.
+        */
+        TInt IndexForId( TInt aId ) const;
+
+        /**
+        * Sets one setting item hidden.
+        * @param aId Identifier of the setting item.
+        * @param aArray Pointer to setting item array.
+        * @param aHidden Boolean hidden value.
+        */
+        void SetItemHidden( TInt aId, CAknSettingItemArray* aArray, TBool aHidden );
+
+		/**
+		* Sets title pane text.
+		* @param aTitle Title pane text.
+		*        If descriptor has zero length, the application name is used.
+		*/
+		void SetTitlePaneTextL( const TDesC& aTitle );
+
+        /**
+        * Updates names of profiles in tabs and/or title pane.
+        */
+        void UpdateProfileNamesL();
+        
+        /*
+        * Launches confirmation dialog
+        * @param aTitleText Dialog title text
+        */
+        void LaunchDialogL( const TDesC& aTitleText );
+        
+        /*
+        * Chechks that used tones assigned for settings can be found.
+        * If tone is not found, user is informed by confirmation dialog
+        * and tone is replaced with default tone. 
+        */
+        void CheckFileExistenceL();
+        
+        /*
+        * Checks whether settingitem is hidden
+        * @param aId Identifier of the setting item.
+        * @param aArray Pointer to setting item array.
+		* @return Returns ETrue if item is hidden.
+        */
+        TBool IsItemHidden( TInt aId, CAknSettingItemArray* aArray ) const;
+
+		/**
+		* Runs CheckFileExistenceL
+		* @param	None
+		* @return	None
+        */
+		void DoFileCheckL();
+
+    protected:  // Functions from base classes
+
+        /**
+        * From CAknSettingItemList
+        */
+        CAknSettingItem* CreateSettingItemL( TInt aIdentifier );
+
+        /**
+        * From CCoeControl
+        */
+        void SizeChanged();
+
+        /**
+        * From CCoeControl
+        */
+        void GetHelpContext( TCoeHelpContext& aContext ) const;
+
+ 		/**
+        * From CCoeControl
+        */
+        void HandleResourceChange(TInt aType);
+
+        /**
+        * From MEikListBoxObserver
+        */
+        void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType );
+
+        /**
+        * From MSSSettingsObserver
+        */
+        void PhoneSettingChanged(
+            TSSSettingsSetting aSetting,
+            TInt aNewValue );
+
+        /**
+        * From MAknTabObserver
+        */
+        void TabChangedL( TInt aIndex );
+
+        /**
+        * From MProfileChangeObserver
+        */
+        void HandleActiveProfileEventL(
+            TProfileEvent aProfileEvent, TInt aProfileId );
+
+        /**
+        * From MProfileExternalSettingsObserver
+        */
+		void HandleExternalSettingsChangedL();
+
+    protected:
+
+        /**
+        * C++ constructor.
+        */
+        CProfileSettingsContainer(
+            MProfileViewHandler& aProfileViewHandler,
+            CProfileEngineHandler& aEngineHandler,
+            MProfileExternalSettingsHandler& aExternalSettingsHandler,
+            CProfileIndexHandler* aIndexHandler,
+            CProfileTabHandler* aTabHandler,
+            CAknTitlePane* aTitlePane );
+
+        /**
+        * Symbian 2nd phase constructor.
+        * @param aRect View rect.
+        * @param aResourceId the id of the setting item list resource.
+        */
+        void ConstructL( const TRect& aRect,
+                         TInt aResourceId );
+
+    public:     // New functions
+
+        /**
+        * Is a setting item being edited?
+        * @return ETrue if a setting is being edited, EFalse otherwise.
+        */
+        IMPORT_C TBool ItemEdited() const;
+                         
+    private:
+        TBool PowerSaveMode();
+        TBool PowerSaveModeL();
+        TBool PowerSaveMode( TInt aSettingId );
+
+    private:    // Data
+
+        // For reading ALS setting and
+        // for receiving change notifications.
+        RSSSettings iSSSettings;
+
+        // Own: CR session for KProfilesLVFlags (KProEngFeatureIdTTSRingingTone)
+        CRepository* iTTSSession;
+        
+        /// Own: CR session for KProEngDefaultRingingTone
+        CRepository* iSession;
+
+        // Resource loader.
+        RConeResourceLoader iResourceLoader;
+
+        // View handler to get ClientRect and set MopParent.
+        MProfileViewHandler& iProfileViewHandler;
+
+        // Profile Engine handler.
+        CProfileEngineHandler& iEngineHandler;
+
+        // Ref: Handler for settings that are saved outside of Profiles:
+        MProfileExternalSettingsHandler& iExternalSettingsHandler;
+
+        // Ref: Index handler.
+        CProfileIndexHandler* iIndexHandler;
+
+        // Ref: Tab handler.
+        CProfileTabHandler* iTabHandler;
+
+        // Ref: Title pane access.
+        CAknTitlePane* iTitlePane;
+
+        // Own: One profile data
+        MProfileExtended* iProfile;
+
+        // Own: One profile data.
+        CProfileStruct* iCopyProfile;
+
+        // Alternate Line Service support.
+        TBool iAlternateLineService;
+
+        // Own: Avkon key sounds
+        CAknKeySoundSystem* iKeySounds;
+
+        // Own: Profile change notify handler.
+        CProfileChangeNotifyHandler* iNotifier;
+
+        // ETrue if an item is currently being edited.
+        TBool iItemEdited;
+
+        // Not own: locally variated features of Profiles:
+        MProfilesLocalFeatures* iLocalFeatures;
+        
+        /// Own: fileserver session
+        RFs* iFs;
+        
+        /// Default tone
+        TFileName* iDefaultTone;
+
+        // VoIP supported
+        TBool iVoIPStatus;
+        
+        // A CR and notifier for dynamic VoIP
+        CRepository* iVoIPVariation;
+        CCenRepNotifyHandler* iVoIPVariationNotifier;
+
+		/// Timer to run CheckFileExistenceL
+		CPeriodic* iPeriodic;
+
+        // Navi Pane Container
+        CProfileNaviPaneContainer* iNaviPaneContainer;
+    };
+
+#endif // CPROFILESETTINGSCONTAINER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewInc/CProfileTabHandler.h	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,149 @@
+/*
+* 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:  Tab handler for handling tabs in Profiles
+*
+*/
+
+
+#ifndef CPROFILETABHANDLER_H
+#define CPROFILETABHANDLER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <AknTabObserver.h>
+
+//  FORWARD DECLARATIONS
+class CProfileEngineHandler;
+class CProfileIndexHandler;
+class CAknNavigationControlContainer;
+class CCoeAppUi;
+class MCoeView;
+class CAknNavigationDecorator;
+class CAknTabGroup;
+
+// CLASS DECLARATION
+
+/**
+*  Tab handler class for handling tabs in Profiles
+*  When instantiated, creates a tab for each profile and puts itself visible.
+*  Needs an instance of Index handler to handle indices of the profiles.
+*  Inherited from MAknTabObserver in order to receive events when tabs change.
+*  That however requires adding the tab group as topmost item in control stack.
+*
+*  @lib CProfileSettingsView.lib
+*  @since 2.5
+*/
+class CProfileTabHandler : public CBase,
+                           public MAknTabObserver
+    {
+    public:     // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        * @param aEngineHandler An instance of Engine Handler.
+        * @param aIndexHandler An instance of Index Handler.
+        * @param aNaviPane An instance of CAknNavigationControlContainer.
+        * @return Returns an instance of CProfileTabHandler.
+        */
+        IMPORT_C static CProfileTabHandler* NewL(
+            CProfileEngineHandler& aEngineHandler,
+            CProfileIndexHandler& aIndexHandler,
+            CAknNavigationControlContainer& aNaviPane );
+
+        // Destructor.
+        ~CProfileTabHandler();
+
+    public:     // New methods
+
+        /**
+        * Returns tab group instance to be added to control stack.
+        * @return Returns tab group instance.
+        */
+        IMPORT_C CAknTabGroup* TabGroup() const;
+
+        /**
+        * Sets a tab active.
+        * @param aIndex Index of the tab to be activated.
+        */
+        void SetActiveTab( TInt aIndex );
+
+        /**
+        * Refreshes tab texts with profile names.
+        */
+        void RefreshTabsL();
+        
+        /**
+        * Sets tab observer.
+        * Tab events are forwarded to the observer if set.
+        * @param aTabObserver Tab observer.
+        */
+        void SetTabObserver( MAknTabObserver* aTabObserver );
+
+    protected:  // New methods
+
+        /**
+        * Creates tab group and reads names of profiles to tab texts.
+        * Separated to own method to enable updating tabs dynamically
+        * (i.e. supports profiles being added or deleted).
+        */
+        void CreateTabGroupL();
+
+    protected:  // From base classes
+
+       /**
+        * From MAknTabObserver
+        */
+        void TabChangedL( TInt aIndex );
+
+    protected:
+
+        /**
+        * C++ constructor.
+        * @param aEngineHandler An instance of Engine Handler.
+        * @param aIndexHandler An instance of Index Handler.
+        * @param aNaviPane An instance of CAknNavigationControlContainer.
+        */
+        CProfileTabHandler(
+            CProfileEngineHandler& aEngineHandler,
+            CProfileIndexHandler& aIndexHandler,
+            CAknNavigationControlContainer& aNaviPane );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private:    // Data
+
+        // Profile Engine handler.
+        CProfileEngineHandler& iEngineHandler;
+
+        // Index handler
+        CProfileIndexHandler& iIndexHandler;
+
+        // Navi pane. Needed for creating tab group.
+        CAknNavigationControlContainer& iNaviPane;
+
+        // Own: Navigation decorator.
+        CAknNavigationDecorator* iNaviDecorator;
+
+        // Ref: Tab group owned by the navigation decorator.
+        CAknTabGroup* iTabGroup;
+
+        // Ref: Tab observer. Tab events are forwarded to the observer if set.
+        MAknTabObserver* iTabObserver;
+
+    };
+
+#endif // CPROFILETABHANDLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewInc/MProfileExternalSettingsHandler.h	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  Interface for loading/storing the settings outside Profiles
+*                itself.
+*
+*/
+
+
+
+#ifndef MPROFILEEXTERNALSETTINGSHANDLER_H
+#define MPROFILEEXTERNALSETTINGSHANDLER_H
+
+//  INCLUDES
+#include <e32std.h>
+
+//  FORWARD DECLARATIONS
+class CAknSettingItem;
+class CAknSettingItemArray;
+class MProfileExternalSettingsObserver;
+class TCoeHelpContext;
+// CLASS DECLARATION
+
+/**
+*  Interface for loading/storing the settings outside Profiles itself.
+*
+*  @lib ProfileSettingsView.dll
+*  @since 3.1
+*/
+class MProfileExternalSettingsHandler
+    {
+
+    public: // New functions
+
+        /**
+        * Creates a setting item for a listbox for editing a setting.
+        * @param aIdentifier identifies the setting to be edited by the item.
+        * @return a setting item for the given setting, the ownership is
+        * transferred to the caller.
+        * @since 3.1
+        */
+		virtual CAknSettingItem* CreateSettingItemL( TInt aIdentifier ) = 0;
+
+        /**
+        * Sets an observer for the external settings.
+        * @param aObserver the observer to be notified when the settings are
+        * changed.
+        * @since 3.1
+        */
+		virtual void SetObserver(
+                MProfileExternalSettingsObserver& aObserver ) = 0;
+
+        /**
+        * Check if the user should be allowed to change the value of the given
+        * setting item or not.
+        * @param aSettingItemId the ID of the setting item to check for.
+        * @return ETrue if modification is allowed, EFalse otherwise.
+        * @since 3.1
+        */
+        virtual TBool AllowedToChange( TInt aSettingItemId ) const = 0;
+            
+        /**
+         * Gets the help context for context sensitive help.
+         * @param aContext the context object in which the help context of the
+         *        component must be set in the implementation of this method.
+         * @return ETrue if this method has set the context appropriately,
+         *         otherwise the caller should set the context by itself.
+         * @since 3.1
+         */
+        virtual TBool GetHelpContext( TCoeHelpContext& /* aContext */ ) const
+            {
+            return EFalse;
+            }
+
+        /**
+         * Sets hidden items in the setting item array.
+         * @param aSettingItemArray array containing the settings items to set
+         *        visible/invisible.
+         * @since 3.1
+         */
+        virtual void SetHiddenItems( CAknSettingItemArray& /* aSettingItemArray */ )
+            const
+            {}
+
+        /**
+         * Checks if the setting with the given setting ID has been modified by
+         * the user and saves the value in storage if it has been changed.
+         * @param aSettingItemId the setting to be checked.
+         * @since 3.1
+         */
+        virtual void StoreIfChangedL( TInt /* aSettingItemId */ ) {}
+
+    };
+
+#endif      // MPROFILEEXTERNALSETTINGSHANDLER_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewInc/MProfileExternalSettingsObserver.h	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,52 @@
+/*
+* 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 observing changes in the settings outside
+*                Profiles itself.
+*
+*/
+
+
+
+#ifndef MPROFILEEXTERNALSETTINGSOBSERVER_H
+#define MPROFILEEXTERNALSETTINGSOBSERVER_H
+
+//  INCLUDES
+#include <e32std.h>
+
+// CLASS DECLARATION
+
+/**
+*  Interface for observing changes in the settings outside Profiles itself.
+*
+*  @lib ProfileSettingsView.dll
+*  @since 3.1
+*/
+class MProfileExternalSettingsObserver
+    {
+
+    public: // New functions
+
+        /**
+        * Notifies that the external settings have changed somehow.
+        * @since 3.1
+        */
+		virtual void HandleExternalSettingsChangedL() = 0;
+
+    };
+
+#endif      // MPROFILEEXTERNALSETTINGSOBSERVER_H
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewInc/MProfileViewHandler.h	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  Interface for getting client rect area and getting reference to
+*                the view in use.
+*
+*/
+
+
+
+#ifndef MPROFILEVIEWHANDLER_H
+#define MPROFILEVIEWHANDLER_H
+
+//  INCLUDES
+#include <e32std.h>
+
+//	FORWARD DECLARATIONS
+class CAknView;
+
+// CLASS DECLARATION
+
+/**
+*  Interface for updating the active area and getting reference to the view in
+*  use.
+*
+*  @lib ProfileSettingsView.dll
+*  @since 3.1
+*/
+class MProfileViewHandler
+    {
+
+    public: // New functions
+
+        /**
+        * Updates the client drawing area.
+        * @since 3.1
+        */
+		virtual void UpdateClientRect() = 0;
+
+        /**
+        * Returns the view instance in use.
+        * @since 3.1
+        */
+		virtual CAknView& View() = 0;
+
+    };
+
+#endif      // MProfileViewHandler_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfile3dSettingItem.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,84 @@
+/*
+* 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:  Setting item class for 3D settings.
+*
+*/
+
+
+
+// INCLUDES
+#include "CProfile3dSettingItem.h"
+#include "CProfile3dSettingPage.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfile3dSettingItem::CProfile3dSettingItem
+// C++ constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CProfile3dSettingItem::CProfile3dSettingItem(
+	TInt aIdentifier,
+	TInt& aValue,
+	const TDesC& aRingingTone,
+	const TInt& aRingingType,
+	const TBool& aVibratingAlert,
+	const TInt& aVolume,
+	const TInt& a3DEffectOrEcho )
+	:	CAknEnumeratedTextPopupSettingItem( aIdentifier, aValue ),
+		iRingingTone( aRingingTone ),
+		iRingingType( aRingingType ),
+		iVibratingAlert( aVibratingAlert ),
+		iVolume( aVolume ),
+		i3DEffectOrEcho( a3DEffectOrEcho )
+	{
+	iIdentifier = aIdentifier;
+	}
+
+// -----------------------------------------------------------------------------
+// CProfile3dSettingItem::CompleteConstructionL
+// -----------------------------------------------------------------------------
+//
+void CProfile3dSettingItem::CompleteConstructionL()
+	{
+	CAknEnumeratedTextPopupSettingItem::CompleteConstructionL();
+	CArrayPtr<CAknEnumeratedText>* array = EnumeratedTextArray();
+	TInt count( array->Count() );
+	HBufC* text = NULL;
+	while( count-- )
+		{
+		text = array->At( count )->Value();
+		TPtr modifiable( text->Des() );
+		AknTextUtils::LanguageSpecificNumberConversion( modifiable );
+		}
+	}
+
+// -----------------------------------------------------------------------------
+// CProfile3dSettingItem::CreateSettingPageL
+// -----------------------------------------------------------------------------
+//
+CAknSettingPage* CProfile3dSettingItem::CreateSettingPageL()
+	{
+	return new( ELeave ) CProfile3dSettingPage(
+		SettingPageResourceId(),
+		*QueryValue(),
+		iRingingTone,
+		iRingingType,
+		iVibratingAlert,
+		iVolume,
+		i3DEffectOrEcho,
+		iIdentifier );
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfile3dSettingItem.h	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,97 @@
+/*
+* 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:  Setting item class for 3D settings.
+*
+*/
+
+
+
+#ifndef CPROFILE3DSETTINGITEM_H
+#define CPROFILE3DSETTINGITEM_H
+
+// INCLUDES
+#include <aknsettingitemlist.h>
+
+// FORWARD DECLARATIONS
+class CAknSettingPage;
+
+// CLASS DECLARATION
+/**
+*  Setting item class for 3D settings.
+*  CProfile3dSettingItem extends CAknEnumeratedTextPopupSettingItem
+*  in order to launch CProfile3dSettingPage
+*  instead of CAknPopupSettingPage.
+*
+*  @lib ProfileSettingsView.lib
+*  @since 5.0
+*/
+NONSHARABLE_CLASS( CProfile3dSettingItem ) : public CAknEnumeratedTextPopupSettingItem
+	{
+	public:		// Constructors and destructor
+
+        /**
+        * C++ constructor.
+        * @param aIdentifier Setting item identifier.
+        * @param aRingingVolume Ringing volume.
+        * @param aRingingTone Ringing tone.
+        * @param aRingingType Ringing type.
+        * @param aVibratingAlert Vibrating alert.
+        * @param aVolume Volume.
+        * @param a3DEffectOrEcho 3D effect/echo
+        */
+		CProfile3dSettingItem(
+			TInt aIdentifier,
+			TInt& aValue,
+			const TDesC& aRingingTone,
+			const TInt& aRingingType,
+			const TBool& aVibratingAlert,
+			const TInt& aVolume,
+			const TInt& a3DEffectOrEcho );
+
+	private:	// Functions from base classes
+
+        /**
+        * From CAknEnumeratedTextPopupSettingItem
+        */
+		void CompleteConstructionL();
+
+        /**
+        * From CAknEnumeratedTextPopupSettingItem
+        */
+		CAknSettingPage* CreateSettingPageL();
+
+	private:	// Data
+
+		// Ringing tone.
+		const TDesC& iRingingTone;
+
+		// Ringing type.
+		const TInt& iRingingType;
+
+		// Vibrating alert.
+		const TBool& iVibratingAlert;
+
+		// Volume.
+		const TInt& iVolume;
+
+		// 3D effect or echo
+        const TInt& i3DEffectOrEcho;
+
+        // Setting item identifier
+        TInt iIdentifier;
+	};
+
+#endif // CPROFILE3DSETTINGITEM_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfile3dSettingPage.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,269 @@
+/*
+* 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:  Setting page class for 3D settings.
+*
+*/
+
+
+
+// INCLUDES
+#include "CProfile3dSettingPage.h"
+#include "ProfileSettingsView.hrh"
+
+#include <CFLDController.h>
+#include <profilesettingsview.rsg>
+#include <apgcli.h>	// For RApaLsSession
+#include <bautils.h> // For BaflUtils
+#include <centralrepository.h>
+#include <ProfileEngineInternalCRKeys.h>
+#include <ProfileInternal.hrh>
+
+// CONSTANTS
+namespace
+	{
+    const TInt K3DEffectBase( 1000 );
+    const TInt K3DEchoBase( 2000 );
+
+	const TInt KRepeatDelayInMicroSeconds( 1000000 ); // One second
+
+#ifdef RD_VIDEO_AS_RINGING_TONE
+	_LIT( KFLDCommonVideoType, "video/*" );
+	_LIT( KFLDRM1VideoMimeType, "application/vnd.rn-realmedia" );
+	_LIT( KFLDRM2VideoMimeType, "application/x-pn-realmedia" );
+	_LIT( KFLDSDPVideoMimeType, "application/sdp" );
+#endif
+
+	}
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfile3dSettingPage::CProfile3dSettingPage
+// C++ constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CProfile3dSettingPage::CProfile3dSettingPage(
+    TInt aResourceID,
+    MAknQueryValue& aQueryValue,
+    const TDesC& aRingingTone,
+    const TInt& aRingingType,
+    const TBool& aVibratingAlert,
+    const TInt& aVolume,
+    const TInt& a3DEffectOrEcho,
+    TInt aIdentifier )
+    :   CAknPopupSettingPage( aResourceID, aQueryValue ),
+        iRingingTone( aRingingTone ),
+        iRingingType( aRingingType ),
+        iVibratingAlert( aVibratingAlert ),
+        iVolume( aVolume ),
+        i3DEffectOrEcho( a3DEffectOrEcho ),
+        iIdentifier( aIdentifier )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfile3dSettingPage::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfile3dSettingPage::ConstructL()
+    {
+    CAknPopupSettingPage::ConstructL();
+
+	TBool showErrorMsgs( EFalse );
+	
+    iFs = new ( ELeave ) RFs;
+    User::LeaveIfError( iFs->Connect() );
+
+	CheckRingingToneTypeL();
+
+    iController = CFLDController::NewL( showErrorMsgs, KRepeatDelayInMicroSeconds );
+	iController->CompleteConstructionL( Window() );
+	iController->SetRingingType( iRingingType );
+	iController->SetVibra( iVibratingAlert );
+	iController->SetVolume( iVolume );
+    }
+
+// Destructor.
+CProfile3dSettingPage::~CProfile3dSettingPage()
+    {
+    if( iFs )
+    	{
+    	iFs->Close();
+    	}
+    delete iFs;
+    delete iController;
+    delete iPreviewTone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfile3dSettingPage::OfferKeyEventL
+// -----------------------------------------------------------------------------
+//
+TKeyResponse CProfile3dSettingPage::OfferKeyEventL(
+    const TKeyEvent& aKeyEvent, TEventCode aType )
+    {
+    if( aType == EEventKey )
+        {
+        if( ( aKeyEvent.iCode == EKeyUpArrow ) ||
+            ( aKeyEvent.iCode == EKeyDownArrow ) )
+            {
+            // Get current setting
+            TInt currentValue = PopupSettingListBox()->CurrentItemIndex();
+
+            // Call base classes method
+            TKeyResponse response( CAknPopupSettingPage::OfferKeyEventL( aKeyEvent, aType ) );
+
+            // Get new setting
+            TInt newValue = PopupSettingListBox()->CurrentItemIndex();
+
+            if( newValue != currentValue )
+                {
+                // Setting has changed
+                if( ( iIdentifier == EProfileSetting3dEffectId && newValue != EProfile3DEffectOff ) ||
+                	( iIdentifier == EProfileSetting3dEchoId && i3DEffectOrEcho != EProfile3DEffectOff ) )
+                	{
+                    // Set 3D parameters
+                	if( iIdentifier == EProfileSetting3dEffectId )
+                		{
+                        iController->Set3dEffects( K3DEffectBase + newValue );
+                        iController->Set3dEffects( K3DEchoBase + i3DEffectOrEcho );
+                		}
+                	else
+                		{
+                        iController->Set3dEffects( K3DEffectBase + i3DEffectOrEcho );
+                        iController->Set3dEffects( K3DEchoBase + newValue );
+                		}
+                	iController->Set3dEffects( ETrue );
+                	}
+                else
+                	{
+                	iController->Set3dEffects( EFalse );
+                	}
+                iController->HandleFileListBoxEventL(
+                    MFLDFileListBoxObserver::EFocusChanged, iPreviewTone->Des() );
+                }
+            return response;
+            }
+        // Cancels playback on any key event
+        iController->HandleFileListBoxEventL(
+            MFLDFileListBoxObserver::EOtherKeyEvent, iPreviewTone->Des() );
+        }
+
+    return CAknPopupSettingPage::OfferKeyEventL( aKeyEvent, aType );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfile3dSettingPage::HandlePointerEventL
+// -----------------------------------------------------------------------------
+//
+void CProfile3dSettingPage::HandlePointerEventL(
+    const TPointerEvent& aPointerEvent )
+    {
+    if( aPointerEvent.iType == TPointerEvent::EButton1Down )
+        {
+        // Get current setting
+        iTempValue = PopupSettingListBox()->CurrentItemIndex();
+        }
+    else if( aPointerEvent.iType == TPointerEvent::EButton1Up )
+    	{
+	    CAknPopupSettingPage::HandlePointerEventL( aPointerEvent );
+        // Get new setting
+        TInt newValue = PopupSettingListBox()->CurrentItemIndex();
+        if( newValue != iTempValue )
+            {
+            // Setting has changed
+            if( ( iIdentifier == EProfileSetting3dEffectId && newValue != EProfile3DEffectOff ) ||
+            	( iIdentifier == EProfileSetting3dEchoId && i3DEffectOrEcho != EProfile3DEffectOff ) )
+            	{
+                // Set 3D parameters
+            	if( iIdentifier == EProfileSetting3dEffectId )
+            		{
+                    iController->Set3dEffects( K3DEffectBase + newValue );
+                    iController->Set3dEffects( K3DEchoBase + i3DEffectOrEcho );
+            		}
+            	else
+            		{
+                    iController->Set3dEffects( K3DEffectBase + i3DEffectOrEcho );
+                    iController->Set3dEffects( K3DEchoBase + newValue );
+            		}
+            	iController->Set3dEffects( ETrue );
+            	}
+            else
+            	{
+            	iController->Set3dEffects( EFalse );
+            	}
+
+            iController->HandleFileListBoxEventL(
+                MFLDFileListBoxObserver::EFocusChanged, iPreviewTone->Des() );
+            }
+        return;
+        }
+    // Cancels playback on any key event
+    iController->HandleFileListBoxEventL(
+        MFLDFileListBoxObserver::EOtherKeyEvent, iPreviewTone->Des() );
+
+    CAknPopupSettingPage::HandlePointerEventL( aPointerEvent );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfile3dSettingPage::CheckRingingToneTypeL
+// -----------------------------------------------------------------------------
+//
+void CProfile3dSettingPage::CheckRingingToneTypeL()
+	{
+	// Get default tone from cenrep
+	TFileName defaultTone;
+	CRepository* cenrep = CRepository::NewL( KCRUidProfileEngine );
+	CleanupStack::PushL( cenrep );
+	User::LeaveIfError( cenrep->Get( KProEngDefaultRingingTone, defaultTone ) );
+	CleanupStack::PopAndDestroy( cenrep );
+
+	if( !BaflUtils::FileExists( *iFs, iRingingTone ) )
+		{
+		// If the file does not exist, use default tone for volume preview
+		iPreviewTone = defaultTone.AllocL();
+		return;
+		}
+
+#ifdef RD_VIDEO_AS_RINGING_TONE
+	// Find out MIME type
+	RApaLsSession apaLsSession;
+	User::LeaveIfError( apaLsSession.Connect() );
+	CleanupClosePushL( apaLsSession );
+	TUid dummyUid = { 0 }; // instantiate as zero
+	TDataType dataType( dummyUid );
+	User::LeaveIfError(
+		apaLsSession.AppForDocument( iRingingTone, dummyUid, dataType ) );
+	CleanupStack::PopAndDestroy(); // apaLsSession.Close()
+
+	// See if this is a video MIME type
+	if ( dataType.Des().MatchF( KFLDCommonVideoType ) == 0 ||
+		dataType.Des().CompareF( KFLDRM1VideoMimeType ) == 0 ||
+		dataType.Des().CompareF( KFLDRM2VideoMimeType ) == 0 ||
+		dataType.Des().CompareF( KFLDSDPVideoMimeType ) == 0 )
+		{
+		iPreviewTone = defaultTone.AllocL();
+		}
+	else
+		{
+		iPreviewTone = iRingingTone.AllocL();
+		}
+#else
+	iPreviewTone = iRingingTone.AllocL();
+#endif
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfile3dSettingPage.h	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,123 @@
+/*
+* 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:  Setting page class for 3D settings.
+*
+*/
+
+
+
+#ifndef CPROFILE3DSETTINGPAGE_H
+#define CPROFILE3DSETTINGPAGE_H
+
+// INCLUDES
+#include <aknpopupsettingpage.h>
+
+// FORWARD DECLARATIONS
+class CFLDController;
+
+// CLASS DECLARATION
+/**
+*  Setting page class for 3D settings.
+*  CProfile3dSettingPage extends CAknPopupSettingPage.
+*
+*  @lib ProfileSettingsView.lib
+*  @since 5.0
+*/
+NONSHARABLE_CLASS( CProfile3dSettingPage ) : public CAknPopupSettingPage
+	{
+	public:		// Constructors and destructor
+
+        /**
+        * C++ constructor.
+        * @param aResourceID Setting page resource ID.
+        * @param aQueryValue
+        * @param aRingingTone Ringing tone.
+        * @param aRingingType Ringing type.
+        * @param aVibratingAlert Vibrating alert.
+        * @param aVolume Volume.
+        * @param a3DEffectOrEcho 3D effect or echo.
+        * @param aIdentifier Setting item identifier.
+        */
+		CProfile3dSettingPage(
+			TInt aResourceID,
+			MAknQueryValue& aQueryValue,
+			const TDesC& aRingingTone,
+			const TInt& aRingingType,
+			const TBool& aVibratingAlert,
+			const TInt& aVolume,
+			const TInt& a3DEffectOrEcho,
+			TInt aIdentifier );
+
+        /**
+        * Symbian 2nd phase constructor.
+        */
+		void ConstructL();
+
+		/**
+		* Destructor.
+		*/
+		~CProfile3dSettingPage();
+
+	private:	// Functions from base classes
+
+        /**
+        * From CCoeControl
+        */
+		TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
+		void HandlePointerEventL(const TPointerEvent& aPointerEvent);
+
+	private:	// New functions
+	
+		/**
+		* Checks if ringing tone is video and if so, sets default tone
+		*/
+		void CheckRingingToneTypeL();
+
+	private:	// Data
+
+		// Ringing tone.
+		const TDesC& iRingingTone;
+
+		// Ringing type.
+		const TInt& iRingingType;
+
+		// Vibrating alert.
+		const TBool& iVibratingAlert;
+
+		// Volume.
+		const TInt& iVolume;
+
+        // 3D effect or echo
+        const TInt& i3DEffectOrEcho;
+
+        // Setting item identifier
+        TInt iIdentifier;
+
+        // Temporary setting value
+        TInt iTempValue;
+
+		// Own: File List Dialog
+		CFLDController* iController;
+		
+		// Preview tone: either ringing tone or default tone
+		HBufC* iPreviewTone;
+
+        // Fileserver session
+        RFs* iFs;
+        
+	};
+
+#endif // CPROFILE3DSETTINGPAGE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileAlertForSettingItem.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,446 @@
+/*
+* 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:  Setting item class for "Alert for" setting.
+*
+*/
+
+
+
+// INCLUDES
+#include "CProfileAlertForSettingItem.h"
+
+#include <coemain.h>
+#include <cntdb.h>
+#include <cntitem.h>
+#include <StringLoader.h>
+#include <CPbkContactEngine.h>
+#include <CPbkContactChangeNotifier.h>
+#include <profilesettingsview.rsg>
+
+#include "CProfileAlertForSettingPage.h"
+
+// CONSTANTS
+const TInt KContactItemArrayGranularity( 8 );
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileAlertForSettingItem::CProfileAlertForSettingItem
+// C++ constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CProfileAlertForSettingItem::CProfileAlertForSettingItem(
+    TInt aIdentifier,
+    RArray<TContactItemId>& aContactList,
+    CCoeEnv* aCoeEnv )
+    :   CAknSettingItem( aIdentifier ),
+        iPopupArray( KContactItemArrayGranularity ),
+        iExternalContactArray( aContactList ),
+        iCoeEnv( aCoeEnv )
+    {
+    }
+
+// Destructor
+CProfileAlertForSettingItem::~CProfileAlertForSettingItem()
+    {
+    delete iChangeNotifier;
+    delete iPbkContactEngine;
+    delete iTextSeveralGroups;
+    delete iTextAllCallers;
+    iFullContactArray.Close();
+    iPopupArray.ResetAndDestroy();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileAlertForSettingItem::CompleteConstructionL
+// -----------------------------------------------------------------------------
+//
+void CProfileAlertForSettingItem::CompleteConstructionL()
+    {
+    // Read localised texts from resource
+    iTextAllCallers = StringLoader::LoadL( R_PROFILE_TEXT_ALL_CALLERS );
+	iTextSeveralGroups = StringLoader::LoadL( R_PROFILE_TEXT_SEVERAL_GROUPS );
+
+    // Create Phonebook contact engine and change notifier
+    iPbkContactEngine = CPbkContactEngine::NewL();
+    iChangeNotifier = iPbkContactEngine->CreateContactChangeNotifierL( this );
+
+    PopulatePopupArrayL();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileAlertForSettingItem::AlertForStatus
+// -----------------------------------------------------------------------------
+//
+CProfileAlertForSettingItem::TAlertForStatus CProfileAlertForSettingItem::AlertForStatus() const
+    {
+    TInt count( iPopupArray.Count() );
+    if( count > 1 )
+        {
+        // Array contains 2 or more items
+        if( SelectionStatus( 0 ) )
+            {
+            // If first item is selected, return EAlertForAllCallers
+            return EAlertForAllCallers;
+            }
+        TInt selectCount( 0 );
+        // Start from index 1, because 0 is "All callers"
+        for( TInt index( 1 ); index < count; index++ )
+            {
+            if( SelectionStatus( index ) )
+                {
+                // Found a selected item, increase counter
+                selectCount++;
+                }
+            }
+        if( selectCount == 1 )
+            {
+            return EAlertForSingleGroup;
+            }
+        return EAlertForSeveralGroups;
+        }
+    // Pop-up array is empty or contains only "All callers"
+    return EAlertForAllCallers;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileAlertForSettingItem::SetSelectionStatus
+// -----------------------------------------------------------------------------
+//
+void CProfileAlertForSettingItem::SetSelectionStatus( TInt aIndex, TBool aStatus )
+    {
+    if( aIndex < iPopupArray.MdcaCount()  )
+	    {
+    	iPopupArray.At( aIndex )->SetSelectionStatus( aStatus );
+	    }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileAlertForSettingItem::SelectionStatus
+// -----------------------------------------------------------------------------
+//
+TBool CProfileAlertForSettingItem::SelectionStatus( TInt aIndex ) const
+    {
+    if( aIndex < iPopupArray.MdcaCount()  )
+	    {
+	    return iPopupArray.At( aIndex )->SelectionStatus();
+	    }
+	else
+		{
+		return EFalse;
+		}	    
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileAlertForSettingItem::PopulatePopupArrayL
+// -----------------------------------------------------------------------------
+//
+void CProfileAlertForSettingItem::PopulatePopupArrayL()
+    {
+    iPopupArray.ResetAndDestroy();
+    iFullContactArray.Reset();
+
+    // Create first item to popup array, "All callers"
+    CSelectableItem* item = new( ELeave ) CSelectableItem(
+        *iTextAllCallers, EFalse );
+    CleanupStack::PushL( item );
+    item->ConstructL();
+    iPopupArray.AppendL( item ); // Ownership is transferred
+    CleanupStack::Pop( item );
+
+    CContactIdArray* groupIdArray = iPbkContactEngine->Database().GetGroupIdListL();
+    CleanupStack::PushL( groupIdArray );
+    TInt count( groupIdArray->Count() );
+    TContactItemId contactId;
+    CContactGroup* contactGroup = NULL;
+    TPtrC contactGroupName;
+    for( TInt index( 0 ); index < count; index++ )
+        {
+        contactId = ( *groupIdArray )[ index ];
+
+        iFullContactArray.Append( contactId );
+        contactGroup = iPbkContactEngine->ReadContactGroupL( contactId );
+        CleanupStack::PushL( contactGroup );
+        contactGroupName.Set( contactGroup->GetGroupLabelL() );
+
+        item = new( ELeave ) CSelectableItem( contactGroupName, EFalse );
+        CleanupStack::PushL( item );
+        item->ConstructL();
+        iPopupArray.AppendL( item ); // Ownership is transferred
+        CleanupStack::Pop( item ); 
+        
+        CleanupStack::PopAndDestroy( contactGroup );
+        }
+
+    CleanupStack::PopAndDestroy( groupIdArray );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileAlertForSettingItem::CheckAllCallersSetting
+// -----------------------------------------------------------------------------
+//
+void CProfileAlertForSettingItem::CheckAllCallersSetting()
+    {
+    TInt count( iPopupArray.Count() );
+    if( count > 0 )
+        {
+        // Check whether the first item, "All callers", is selected or not.
+        if( SelectionStatus( 0 ) )
+            {
+            // "All callers" is selected.
+            // Set other groups unselected.
+            for( TInt index( 1 ); index < count; index++ )
+                {
+                SetSelectionStatus( index, EFalse );
+                }
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileAlertForSettingItem::UpdateSettingPageL
+// -----------------------------------------------------------------------------
+//
+void CProfileAlertForSettingItem::UpdateSettingPageL()
+    {
+    // Closing and opening the database has  because
+    // the database doesn't update its information otherwise
+    iPbkContactEngine->Database().CloseTables();
+    iPbkContactEngine->Database().OpenTablesL();
+
+    RArray<TContactItemId> selectedContacts;
+    CleanupClosePushL( selectedContacts );
+    StoreL( selectedContacts );
+    PopulatePopupArrayL();
+    LoadL( selectedContacts );
+    CleanupStack::PopAndDestroy(); // selectedContacts
+
+    UpdateListBoxTextL(); // Calls SettingTextL()
+
+    if( SettingPage() )
+        {
+        // Pop-up is popped up
+        CProfileAlertForSettingPage* sp =
+            static_cast< CProfileAlertForSettingPage* >( SettingPage() );
+        TInt lastIndex( iPopupArray.Count() - 1 );
+        TInt currentIndex( sp->ListBoxControl()->View()->CurrentItemIndex() );
+        if( currentIndex > lastIndex )
+            {
+            sp->ListBoxControl()->SetCurrentItemIndex( lastIndex );
+            }
+        if( currentIndex < 0 )
+            {
+            sp->ListBoxControl()->SetCurrentItemIndex( 0 );
+            }
+
+        // Must clear listbox view's selections, because if items have been deleted,
+        // non existent selections remain in view's selection array.
+        sp->ListBoxControl()->View()->ClearSelection();
+        // Set the new selection array to setting page
+        sp->SetSelectionItemArrayL( &iPopupArray );
+        // Update possibly changed CBA visibility
+        sp->UpdateCba();
+        }
+    else // Setting page is not visible
+        {
+        LoadL();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileAlertForSettingItem::StoreL
+// -----------------------------------------------------------------------------
+//
+void CProfileAlertForSettingItem::StoreL( RArray<TContactItemId>& aArray ) const
+    {
+    aArray.Reset();
+    TInt count( iPopupArray.Count() );
+    // Start from index 1 (0 is 'All callers')
+    for( TInt index( 1 ); index < count; index++ )
+        {
+        // If an item in array is selected
+        if( SelectionStatus( index ) )
+            {
+            // Add its id to external contact array
+            aArray.Append( iFullContactArray[ index - 1 ] );
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileAlertForSettingItem::LoadL
+// -----------------------------------------------------------------------------
+//
+void CProfileAlertForSettingItem::LoadL( const RArray<TContactItemId>& aArray )
+    {
+    TInt index( 0 );
+    TInt count( iPopupArray.Count() );
+
+    // Set all selections false
+    for( ; index < count; index++ )
+        {
+        SetSelectionStatus( index, EFalse );
+        }
+
+    TContactItemId contactId;
+    TInt foundCount( 0 );
+    TInt foundIndex;
+    count = aArray.Count();
+    for( index = 0; index < count; index++ )
+        {
+        contactId = aArray[ index ];
+        // Try to find contact id from full contact group array
+        foundIndex = iFullContactArray.Find( contactId );
+        if( foundIndex >= 0 )
+            {
+            // Indices in iFullContactArray are the same as in iPopupArray
+            // except that iPopupArray's 1st item is "All callers". Therefore + 1.
+            SetSelectionStatus( foundIndex + 1, ETrue );
+            // A valid contact id is found, increase counter
+            foundCount++;
+            }
+        }
+
+    // If there were no contact groups selected,
+    // or selected groups are not longer valid, select "All callers"
+    if( foundCount == 0 )
+        {
+        SetSelectionStatus( 0, ETrue );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileAlertForSettingItem::StoreL
+// -----------------------------------------------------------------------------
+//
+void CProfileAlertForSettingItem::StoreL()
+    {
+    StoreL( iExternalContactArray );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileAlertForSettingItem::LoadL
+// -----------------------------------------------------------------------------
+//
+void CProfileAlertForSettingItem::LoadL()
+    {
+    LoadL( iExternalContactArray );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileAlertForSettingItem::EditItemL
+// -----------------------------------------------------------------------------
+//
+void CProfileAlertForSettingItem::EditItemL( TBool /* aCalledFromMenu */ )
+    {
+    CProfileAlertForSettingPage* dlg = new( ELeave ) CProfileAlertForSettingPage(
+        SettingPageResourceId(), &iPopupArray );
+    SetSettingPage( dlg ); // Set iSettingPage to indicate that pop-up is displayed
+    dlg->SetSettingPageObserver( this );
+    dlg->ExecuteLD();
+    SetSettingPage( NULL ); // iSettingPage is NULL, pop-up is closed
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileAlertForSettingItem::SettingTextL
+// -----------------------------------------------------------------------------
+//
+const TDesC& CProfileAlertForSettingItem::SettingTextL()
+    {
+    switch( AlertForStatus() )
+        {
+        case EAlertForAllCallers:
+            {
+            iSettingText = *iTextAllCallers;
+            break;
+            }
+        case EAlertForSingleGroup:
+            {
+            TInt count( iPopupArray.Count() );
+            if( count > 0 )
+                {
+                // Search the selected group
+                while( !SelectionStatus( --count ) && count > 1 ) {}
+                // Get its name
+                iSettingText = iPopupArray.At( count )->ItemText();
+                }
+            break;
+            }
+        case EAlertForSeveralGroups:
+            {
+            iSettingText = *iTextSeveralGroups;
+            break;
+            }
+        default:
+            {
+            break;
+            }
+        }
+    return iSettingText;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileAlertForSettingItem::HandleDatabaseEventL
+// -----------------------------------------------------------------------------
+//
+void CProfileAlertForSettingItem::HandleDatabaseEventL( TContactDbObserverEvent aEvent )
+    {
+    if( ( aEvent.iType == EContactDbObserverEventGroupAdded ) || // A contact item group has been added.
+        ( aEvent.iType == EContactDbObserverEventGroupChanged ) || // A contact item group has been updated.
+        ( aEvent.iType == EContactDbObserverEventGroupDeleted ) ) // A contact item group has been deleted from the database.
+        {
+        UpdateSettingPageL();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileAlertForSettingItem::HandleSettingPageEventL
+// After settings have been accepted, some checks are made in this method.
+// If "Alert for" is selected , all other groups must be unselected.
+// If nothing is selected , "Alert for" must be selected.
+// -----------------------------------------------------------------------------
+//
+void CProfileAlertForSettingItem::HandleSettingPageEventL(
+    CAknSettingPage* aSettingPage, TAknSettingPageEvent aEventType )
+    {
+    switch( aEventType )
+        {
+        case EEventSettingOked:
+            {
+            // Check that "All callers" is in correct state
+            CheckAllCallersSetting();
+            break;
+            }
+        case EEventSettingCancelled:
+            {
+            // If setting is cancelled, load old values
+            LoadL();
+            break;
+            }
+        case EEventSettingChanged:
+            {
+            // If setting has changed, update CBA visibility
+            static_cast<CProfileAlertForSettingPage*>( aSettingPage )->UpdateCba();
+            break;
+            }
+        default:
+            {
+            break;
+            }
+        }
+    CAknSettingItem::HandleSettingPageEventL( aSettingPage, aEventType );
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileAlertForSettingItem.h	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,202 @@
+/*
+* 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:  Setting item class for "Alert for" setting.
+*
+*/
+
+
+
+#ifndef CPROFILEALERTFORSETTINGITEM_H
+#define CPROFILEALERTFORSETTINGITEM_H
+
+// INCLUDES
+#include <aknsettingitemlist.h>
+#include <MPbkContactDbObserver.h>
+#include <akncheckboxsettingpage.h> // For CSelectionItemList member data
+
+// FORWARD DECLARATIONS
+class CCoeEnv;
+class CPbkContactChangeNotifier;
+
+// CONSTANTS
+const TInt KMaxPbkContactGroupNameLength( 64 );
+
+// CLASS DECLARATION
+/**
+*  Setting item class for "Alert for" setting.
+*  CProfileAlertForSettingItem reads user defined groups from
+*  Phonebook contact database and shows a list of the groups
+*  in a check box setting page (CAknCheckBoxSettingPage).
+*  CProfileAlertForSettingItem is inherited from MPbkContactDbObserver
+*  in order to catch Phonebook contact group change events and
+*  dynamically update its contents.
+*
+*  @lib ProfileSettingsView.lib
+*  @since 1.2
+*/
+NONSHARABLE_CLASS( CProfileAlertForSettingItem ) : public CAknSettingItem
+								  ,public MPbkContactDbObserver
+	{
+
+	public:		// Constructors and destructor
+
+        /**
+        * C++ constructor.
+        * @param aIdentifier Resource identifier.
+        * @aContactList Array where selected contact groups are stored.
+        * @aCoeEnv A pointer to Control Environment.
+        */
+        CProfileAlertForSettingItem(
+			TInt aIdentifier,
+			RArray<TContactItemId>& aContactList,
+			CCoeEnv* aCoeEnv );
+
+		/**
+		* Destructor
+		*/
+		~CProfileAlertForSettingItem();
+
+	private:	// Enumerations
+
+		enum TAlertForStatus
+			{
+			EAlertForAllCallers,
+			EAlertForSingleGroup,
+			EAlertForSeveralGroups
+			};
+
+	private:	// New functions
+
+		/**
+		* Resolves the alert for status of iPopupArray.
+		* @return Returns the alert for status of iPopupArray.
+		*/
+		TAlertForStatus AlertForStatus() const;
+
+		/**
+		* Sets selection status to iPopupArray at specified index.
+		* @param aIndex Index in iPopupArray.
+		* @param aStatus Selection status of an item.
+		*/
+		void SetSelectionStatus( TInt aIndex, TBool aStatus );
+
+		/**
+		* Returns selection status of an item in iPopupArray.
+		* @param aIndex Index in iPopupArray.
+		* @return Returns selection status of an item.
+		*/
+		TBool SelectionStatus( TInt aIndex ) const;
+
+		/**
+		* Populates iPopupArray. Reads contact group names from Phonebook engine.
+		*/
+		void PopulatePopupArrayL();
+
+		/**
+		* Sets other groups unselected if "All callers" has been selected.
+		*/
+		void CheckAllCallersSetting();
+
+		/**
+		* Updates iPopupArray and if setting page is opened,
+		* updates items of the setting page too.
+		*/
+		void UpdateSettingPageL();
+
+		/**
+		* Stores currently selected groups to given array.
+		* @param aArray An array to store currently selected groups to.
+		*/
+		void StoreL( RArray<TContactItemId>& aArray ) const;
+
+		/**
+		* Loads selected groups from given array and sets them to iPopupArray.
+		* @param aArray An array to load currently selected groups from.
+		*/
+		void LoadL( const RArray<TContactItemId>& aArray );
+
+	private:	// Functions from base classes
+
+        /**
+        * From CAknSettingItem
+        */
+        void CompleteConstructionL();
+
+        /**
+        * From CAknSettingItem
+        */
+		void StoreL();
+
+        /**
+        * From CAknSettingItem
+        */
+		void LoadL();
+
+        /**
+        * From CAknSettingItem
+        */
+		void EditItemL( TBool aCalledFromMenu );
+
+        /**
+        * From CAknSettingItem
+        */
+		const TDesC& SettingTextL();
+
+        /**
+        * From MPbkContactDbObserver
+        */
+		void HandleDatabaseEventL( TContactDbObserverEvent aEvent );
+
+        /**
+        * From MAknSettingPageObserver
+        */
+		void HandleSettingPageEventL(
+			CAknSettingPage* aSettingPage,
+			TAknSettingPageEvent aEventType );
+
+	private:	// Data
+
+		// Contains all items in check box setting list
+		// (item name string and selection status boolean value)
+		CSelectionItemList iPopupArray;
+
+		// Own: Localised text "All callers"
+		HBufC* iTextAllCallers;
+
+		// Own: Localised text "Several groups"
+		HBufC* iTextSeveralGroups;
+
+		// Text to return with SettingTextL()
+		TBuf<KMaxPbkContactGroupNameLength> iSettingText;
+
+		// An array which contains contact item id:s of all contact groups
+		RArray<TContactItemId> iFullContactArray;
+
+		// Array of selected contact groups
+		RArray<TContactItemId>& iExternalContactArray;
+
+		// Own: PhoneBook contact change notifier
+		CPbkContactChangeNotifier* iChangeNotifier;
+
+		// Own: PhoneBook contact engine
+		CPbkContactEngine* iPbkContactEngine;
+
+		// Ref: Pointer to Control Environment
+		CCoeEnv* iCoeEnv;
+
+	};
+
+#endif // CPROFILEALERTFORSETTINGITEM_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileAlertForSettingPage.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  Setting page class for "Alert for" setting.
+*
+*/
+
+
+
+// INCLUDES
+#include "CProfileAlertForSettingPage.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileAlertForSettingPage::CProfileAlertForSettingPage
+// C++ constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CProfileAlertForSettingPage::CProfileAlertForSettingPage(
+	TInt aResourceID,
+	CSelectionItemList* aItemArray )
+	:	CAknCheckBoxSettingPage( aResourceID, aItemArray )
+	{
+	}
+
+// -----------------------------------------------------------------------------
+// CProfileAlertForSettingPage::UpdateCba
+// -----------------------------------------------------------------------------
+//
+void CProfileAlertForSettingPage::UpdateCba()
+	{
+	// Cache the pointer to button group container
+	CEikButtonGroupContainer* cba = Cba();
+	// Left softkey should be visible if there are items selected,
+	// i.e. the selection index array has items.
+	TBool visible( ListBoxControl()->View()->SelectionIndexes()->Count() > 0 );
+	// Resolve left softkey command id
+	TInt leftId( cba->ButtonGroup()->CommandId( 0 ) );
+	// Check if left softkey visibility has changed
+	if( visible != cba->IsCommandVisible( leftId ) )
+		{
+		// Left softkey visibility has changed, update it
+		cba->MakeCommandVisible( leftId, visible );
+		}
+		cba->DrawDeferred();
+	}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileAlertForSettingPage.h	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  Setting page class for "Alert for" setting.
+*
+*/
+
+
+
+#ifndef CPROFILEALERTFORSETTINGPAGE_H
+#define CPROFILEALERTFORSETTINGPAGE_H
+
+// INCLUDES
+#include <akncheckboxsettingpage.h>
+
+// CLASS DECLARATION
+/**
+*  Setting page class for "Alert for" setting.
+*  CProfileAlertForSettingPage extends CAknCheckBoxSettingPage in order to
+*  hide left softkey when no contact groups are selected. However, it is
+*  the responsibility of the setting page observer to call UpdateCbaL, when
+*  setting changes.
+*
+*  @lib ProfileSettingsView.lib
+*  @since 1.2
+*/
+NONSHARABLE_CLASS( CProfileAlertForSettingPage )
+ : public CAknCheckBoxSettingPage
+	{
+
+	public:		// Constructor
+
+        /**
+        * C++ constructor.
+        * @param aResourceID Setting page resource id.
+        * @param aItemArray The array which contains all setting items.
+        */
+        CProfileAlertForSettingPage(
+			TInt aResourceID, CSelectionItemList* aItemArray );
+
+	public:		// New functions
+
+		/**
+		* Hides left softkey (Ok) if no items are selected.
+		*/
+		void UpdateCba();
+
+	};
+
+#endif // CPROFILEALERTFORSETTINGPAGE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileEngineHandler.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,114 @@
+/*
+* 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 handler
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "CProfileEngineHandler.h"
+
+#include <MProfileEngineExtended.h>
+#include <MProfilesNamesArray.h>
+#include <MProfileName.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileEngineHandler::CProfileEngineHandler
+// C++ default constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CProfileEngineHandler::CProfileEngineHandler()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineHandler::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfileEngineHandler::ConstructL()
+    {
+    // Create the Profile Engine
+    iEngine = CreateProfileEngineExtendedL();
+    // Get a list of profile Id:s
+    ReadIdArrayL();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineHandler::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CProfileEngineHandler* CProfileEngineHandler::NewL()
+    {
+    CProfileEngineHandler* self = new( ELeave ) CProfileEngineHandler();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// Destructor.
+CProfileEngineHandler::~CProfileEngineHandler()
+    {
+    delete iIdArray;
+    if( iEngine )
+        {
+        iEngine->Release();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineHandler::Engine
+// -----------------------------------------------------------------------------
+//
+EXPORT_C MProfileEngineExtended* CProfileEngineHandler::Engine() const
+    {
+    return iEngine;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineHandler::ReadIdArrayL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CProfileEngineHandler::ReadIdArrayL()
+    {
+    MProfilesNamesArray* idArray = iEngine->ProfilesNamesArrayLC();
+    CleanupStack::Pop();
+    delete iIdArray;
+    iIdArray = idArray;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineHandler::IdArray
+// -----------------------------------------------------------------------------
+//
+EXPORT_C MProfilesNamesArray* CProfileEngineHandler::IdArray() const
+    {
+    return iIdArray;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileEngineHandler::IdForIndex
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CProfileEngineHandler::IdForIndex( TInt aIndex ) const
+    {
+    return iIdArray->ProfileName( aIndex )->Id();
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileFeedbackSettingItem.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  Setting item class for Feedback settings.
+*
+*/
+
+
+
+// INCLUDES
+#include "CProfileFeedbackSettingItem.h"
+#include "CProfileFeedbackSettingPage.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileFeedbackSettingItem::CProfileFeedbackSettingItem
+// C++ constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CProfileFeedbackSettingItem::CProfileFeedbackSettingItem(
+	TInt aIdentifier, TInt& aValue )
+	:	CAknEnumeratedTextPopupSettingItem( aIdentifier, aValue )
+	{
+	iIdentifier = aIdentifier;
+	}
+
+// -----------------------------------------------------------------------------
+// CProfileFeedbackSettingItem::CompleteConstructionL
+// -----------------------------------------------------------------------------
+//
+void CProfileFeedbackSettingItem::CompleteConstructionL()
+	{
+	CAknEnumeratedTextPopupSettingItem::CompleteConstructionL();
+	CArrayPtr<CAknEnumeratedText>* array = EnumeratedTextArray();
+	TInt count( array->Count() );
+	HBufC* text = NULL;
+	while( count-- )
+		{
+		text = array->At( count )->Value();
+		TPtr modifiable( text->Des() );
+		AknTextUtils::LanguageSpecificNumberConversion( modifiable );
+		}
+	}
+
+// -----------------------------------------------------------------------------
+// CProfileFeedbackSettingItem::CreateSettingPageL
+// -----------------------------------------------------------------------------
+//
+CAknSettingPage* CProfileFeedbackSettingItem::CreateSettingPageL()
+	{
+	return new( ELeave ) CProfileFeedbackSettingPage(
+		SettingPageResourceId(),
+		*QueryValue(),
+		iIdentifier );
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileFeedbackSettingItem.h	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,72 @@
+/*
+* 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:  Setting item class for Feedback settings.
+*
+*/
+
+
+
+#ifndef CPROFILEFEEDBACKSETTINGITEM_H
+#define CPROFILEFEEDBACKSETTINGITEM_H
+
+// INCLUDES
+#include <aknsettingitemlist.h>
+
+// FORWARD DECLARATIONS
+class CAknSettingPage;
+
+// CLASS DECLARATION
+/**
+*  Setting item class for Feedback settings.
+*  CProfileFeedbackSettingItem extends CAknEnumeratedTextPopupSettingItem
+*  in order to launch CProfileFeedbackSettingPage
+*  instead of CAknPopupSettingPage.
+*
+*  @lib ProfileSettingsView.lib
+*  @since 5.0
+*/
+NONSHARABLE_CLASS( CProfileFeedbackSettingItem ) : public CAknEnumeratedTextPopupSettingItem
+	{
+	public:		// Constructors and destructor
+
+        /**
+        * C++ constructor.
+        * @param aIdentifier Setting item identifier.
+        * @param aValue Feedback setting value.
+        */
+		CProfileFeedbackSettingItem(
+			TInt aIdentifier,
+			TInt& aValue );
+
+	private:	// Functions from base classes
+
+        /**
+        * From CAknEnumeratedTextPopupSettingItem
+        */
+		void CompleteConstructionL();
+
+        /**
+        * From CAknEnumeratedTextPopupSettingItem
+        */
+		CAknSettingPage* CreateSettingPageL();
+
+	private:	// Data
+
+        // Setting item identifier
+        TInt iIdentifier;
+	};
+
+#endif // CPROFILEFEEDBACKSETTINGITEM_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileFeedbackSettingPage.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,111 @@
+/*
+* 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:  Setting page class for Feedback settings.
+*
+*/
+
+
+
+// INCLUDES
+#include <profilesettingsview.rsg>
+#include <StringLoader.h>	// For StringLoader
+#include <aknnotewrappers.h> // For CAknInformationNote
+
+// for power save mode handling
+#include <psmsettings.h>
+#include <psmsrvdomaincrkeys.h>
+#include <centralrepository.h>
+
+#include "CProfileFeedbackSettingPage.h"
+#include "ProfileSettingsView.hrh"
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileFeedbackSettingPage::CProfileFeedbackSettingPage
+// C++ constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CProfileFeedbackSettingPage::CProfileFeedbackSettingPage(
+    TInt aResourceID,
+    MAknQueryValue& aQueryValue,
+    TInt aIdentifier )
+    :   CAknPopupSettingPage( aResourceID, aQueryValue ),
+        iIdentifier( aIdentifier )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileFeedbackSettingPage::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfileFeedbackSettingPage::ConstructL()
+    {
+    CAknPopupSettingPage::ConstructL();
+    }
+
+// Destructor.
+CProfileFeedbackSettingPage::~CProfileFeedbackSettingPage()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileFeedbackSettingPage::OkToExitL
+// -----------------------------------------------------------------------------
+//
+TBool CProfileFeedbackSettingPage::OkToExitL( TBool aAccept )
+    {
+    if( aAccept )
+        {
+        TInt psm = EPsmsrvModeNormal;
+        CRepository* cenrep = CRepository::NewLC( KCRUidPowerSaveMode );
+        cenrep->Get( KPsmCurrentMode, psm );
+        CleanupStack::PopAndDestroy( cenrep );
+        if( psm == EPsmsrvModePowerSave )
+            {
+            HBufC* buf = StringLoader::LoadLC( R_PROFILE_TEXT_PSM_INFONOTE );
+            CAknInformationNote* queryDialog = new (ELeave) CAknInformationNote( EFalse );
+         	queryDialog->ExecuteLD( *buf );
+            CleanupStack::PopAndDestroy( buf );
+            }
+        }
+    return ETrue;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfileFeedbackSettingPage::OfferKeyEventL
+// -----------------------------------------------------------------------------
+//
+TKeyResponse CProfileFeedbackSettingPage::OfferKeyEventL(
+    const TKeyEvent& aKeyEvent, TEventCode aType )
+    {
+    return CAknPopupSettingPage::OfferKeyEventL( aKeyEvent, aType );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfileFeedbackSettingPage::HandlePointerEventL
+// -----------------------------------------------------------------------------
+//
+void CProfileFeedbackSettingPage::HandlePointerEventL(
+    const TPointerEvent& aPointerEvent )
+    {
+    CAknPopupSettingPage::HandlePointerEventL( aPointerEvent );
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileFeedbackSettingPage.h	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,90 @@
+/*
+* 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:  Setting page class for Feedback settings.
+*
+*/
+
+
+
+#ifndef CPROFILEFEEDBACKSETTINGPAGE_H
+#define CPROFILEFEEDBACKSETTINGPAGE_H
+
+// INCLUDES
+#include <aknpopupsettingpage.h>
+
+// FORWARD DECLARATIONS
+class CFLDController;
+
+// CLASS DECLARATION
+/**
+*  Setting page class for Feedback settings.
+*  CProfileFeedbackSettingPage extends CAknPopupSettingPage.
+*
+*  @lib ProfileSettingsView.lib
+*  @since 5.0
+*/
+NONSHARABLE_CLASS( CProfileFeedbackSettingPage ) : public CAknPopupSettingPage
+	{
+	public:		// Constructors and destructor
+
+        /**
+        * C++ constructor.
+        * @param aResourceID Setting page resource ID.
+        * @param aQueryValue
+        * @param aIdentifier Setting item identifier.
+        */
+		CProfileFeedbackSettingPage(
+			TInt aResourceID,
+			MAknQueryValue& aQueryValue,
+			TInt aIdentifier );
+
+        /**
+        * Symbian 2nd phase constructor.
+        */
+		void ConstructL();
+
+		/**
+		* Destructor.
+		*/
+		~CProfileFeedbackSettingPage();
+
+	private:	// Functions from base classes
+
+        /**
+        * From CCoeControl
+        */
+		TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
+		void HandlePointerEventL(const TPointerEvent& aPointerEvent);
+
+        /**
+        * From CAknSettingPage
+        */
+		TBool OkToExitL( TBool aAccept );
+
+	private:	// New functions
+	
+
+	private:	// Data
+
+        // Setting item identifier
+        TInt iIdentifier;
+
+        // Temporary setting value
+        TInt iTempValue;
+
+	};
+
+#endif // CPROFILEFEEDBACKSETTINGPAGE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileFileListSettingItem.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,272 @@
+/*
+* 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:  Setting item class for tone selection.
+*
+*/
+
+
+
+// CLASS HEADER
+#include "CProfileFileListSettingItem.h"
+
+// INTERNAL INCLUDES
+#include <coemain.h>
+
+#include <Profile.hrh> // From Profile Engine
+#include <StringLoader.h>
+#include <centralrepository.h>
+#include <ProfileEngineInternalCRKeys.h>
+#include <profilesettingsview.rsg>
+#include <data_caging_path_literals.hrh>
+#include <CLFContentListing.hrh>	// For TCLFMediaType::ECLFMediaTypeVideo
+#include <featdiscovery.h> // CFeatureDiscovery
+
+// for mediafilelist
+#include <mediafilelist.h>
+#include <ProfileInternal.hrh>
+#include <DRMHelper.h>
+
+
+// EXTERNAL INCLUDES
+#include "ProfilePanics.h"
+#include "ProfileSettingsView.hrh"
+
+namespace
+	{
+// CONSTANTS
+	_LIT( KIgnoredExtension, ".RNG" );
+	_LIT( KProfileSilentTone, "Z:No_Sound.wav" );
+
+	_LIT( KProfileAudioMpeg, "audio/mpegurl" );
+	_LIT( KProfileAudioRAPlugin, "audio/x-pn-realaudio-plugin" );
+#ifndef __WMA
+	_LIT( KProfileAudioWMA, "audio/x-ms-wma" );
+#endif
+	}
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileFileListSettingItem::CProfileFileListSettingItem
+// C++ constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CProfileFileListSettingItem::CProfileFileListSettingItem(
+    TInt aIdentifier,
+    TDes& aToneFileName,
+    const TInt& aRingingType,
+    const TInt& aRingingVolume,
+    const TBool& aVibratingAlert,
+    TInt& a3DEffect,
+    TInt& a3DEcho,
+    CCoeEnv* aCoeEnv )
+    :   CAknSettingItem( aIdentifier ),
+        iExternalToneFileName( aToneFileName ),
+        iRingingType( aRingingType ),
+        iRingingVolume( aRingingVolume ),
+        iVibratingAlert( aVibratingAlert ),
+        i3DEffect( a3DEffect ),
+        i3DEcho( a3DEcho ),
+        iCoeEnv( aCoeEnv )
+    {
+    }
+
+// Destructor
+CProfileFileListSettingItem::~CProfileFileListSettingItem()
+    {
+    delete iTitle;
+    delete iNoSoundFileName;
+    delete iNoSoundText;
+    delete iInternalToneFileName;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileFileListSettingItem::CompleteConstructionL
+// -----------------------------------------------------------------------------
+//
+void CProfileFileListSettingItem::CompleteConstructionL()
+    {
+    iNoSoundText =
+		StringLoader::LoadL( R_PROFILE_TEXT_NONE );
+
+	TFileName fileName;
+	TParse* fp = new(ELeave) TParse();
+	fp->Set(KProfileSilentTone, &KDC_RESOURCE_FILES_DIR, NULL);
+	fileName.Copy( fp->FullName() );
+	delete fp;
+	iNoSoundFileName = fileName.AllocL();
+    iTitle =
+        StringLoader::LoadL( R_PROFILE_TEXT_SELECT_TONE );
+
+	iInternalToneFileName = new( ELeave ) TFileName();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileFileListSettingItem::StoreL
+// -----------------------------------------------------------------------------
+//
+void CProfileFileListSettingItem::StoreL()
+    {
+    if( iInternalToneFileName->Length() == 0 )
+        {
+        iInternalToneFileName->Copy( iNoSoundFileName->Des() );
+        }
+    iExternalToneFileName.Copy( *iInternalToneFileName );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileFileListSettingItem::LoadL
+// -----------------------------------------------------------------------------
+//
+void CProfileFileListSettingItem::LoadL()
+    {
+    iInternalToneFileName->Copy( iExternalToneFileName );
+    
+    if( iInternalToneFileName->Length() == 0 )
+        {
+        iInternalToneFileName->Copy( iNoSoundFileName->Des() );
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfileFileListSettingItem::EditItemL
+// -----------------------------------------------------------------------------
+//
+void CProfileFileListSettingItem::EditItemL( TBool /*aCalledFromMenu*/ )
+    {
+    TInt ringingType( iRingingType );
+    TInt id( Identifier() );
+    if( ( id == EProfileSettingMessageAlertToneId ) ||
+        ( id == EProfileSettingEmailAlertToneId ) )
+        {
+        // Message alert tone is always played EProfileRingingTypeRingingOnce
+        // Exceptions are Silent and Beeb Once
+         if( ( ringingType == EProfileRingingTypeRinging ) ||
+            ( ringingType == EProfileRingingTypeAscending ) )
+            {
+            ringingType = EProfileRingingTypeRingingOnce;
+            }
+        }
+
+    TFileName fileName;
+    TInt nullItem = KErrNotFound;    
+        
+    CMediaFileList* list = CMediaFileList::NewL();
+    CleanupStack::PushL( list );
+
+    list->SetAttrL( CMediaFileList::EAttrTitle, *iTitle );
+    list->SetAttrL( CMediaFileList::EAttrVolume, iRingingVolume );
+    list->SetAttrL( CMediaFileList::EAttrVibra, iVibratingAlert );
+    list->SetAttrL( CMediaFileList::EAttrRingingType, ringingType );
+    list->SetAttrL( CMediaFileList::EAttrExcludeMimeType, KProfileAudioMpeg );
+    list->SetAttrL( CMediaFileList::EAttrExcludeMimeType, KProfileAudioRAPlugin );
+#ifndef __WMA
+    list->SetAttrL( CMediaFileList::EAttrExcludeMimeType, KProfileAudioWMA );
+#endif
+  
+    list->SetAttrL( CMediaFileList::EAttrAutomatedType, CDRMHelper::EAutomatedTypeRingingTone );
+
+    if( id == EProfileSettingPTTRingingToneId )
+        {
+        // PTT does not allow videos
+        list->SetAttrL( CMediaFileList::EAttrExcludeFolder, CMediaFileList::EMediaFileTypeVideo );
+        }
+
+    if( id == EProfileSettingMessageAlertToneId )
+        {
+        list->SetAttrL( CMediaFileList::EAttrAutomatedType, CDRMHelper::EAutomatedTypeMessageAlert );
+        }
+    else if( id == EProfileSettingEmailAlertToneId )
+        {
+        list->SetAttrL( CMediaFileList::EAttrAutomatedType, CDRMHelper::EAutomatedTypeEmailAlert );
+        }
+       
+    // Size limit for voice call tone files
+    // Messaging tone size is also limited if the
+    // "FF_LIMITED_MESSAGE_AND_ALARM_TONE_SIZE" feature flag is enabled
+    if ( id == EProfileSettingRingingToneId      ||
+         id == EProfileSettingRingingToneLine1Id ||
+         id == EProfileSettingRingingToneLine2Id ||
+         ( id == EProfileSettingMessageAlertToneId &&
+           CFeatureDiscovery::IsFeatureSupportedL( KFeatureIdFfLimitedMessageAndAlarmToneSize ) ) )
+        {
+        TInt sizeLimitKB = 0;
+        CRepository* cenrep = CRepository::NewL( KCRUidProfileEngine );
+        CleanupStack::PushL( cenrep );
+        User::LeaveIfError( cenrep->Get( KProEngRingingToneMaxSize, sizeLimitKB ) );
+        CleanupStack::PopAndDestroy(); // cenrep
+
+        list->SetAttrL( CMediaFileList::EAttrFileSize, sizeLimitKB );
+
+        }
+
+    list->SetAttrL( CMediaFileList::EAttr3DEffect, i3DEffect );
+    list->SetAttrL( CMediaFileList::EAttr3DEcho, i3DEcho );
+
+    list->SetNullItemL( *iNoSoundText, *iNoSoundFileName,
+                        CMediaFileList::EMediaFileTypeAudio,
+                        CMediaFileList::ENullItemIconOff );
+        
+    TInt ret = list->ShowMediaFileListL( iInternalToneFileName, &nullItem, NULL, NULL );
+     
+    CleanupStack::PopAndDestroy( list );
+
+    if( ret )
+        {
+        // Setting Oked.
+        UpdateListBoxTextL();
+        }
+    }
+
+
+
+
+// -----------------------------------------------------------------------------
+// CProfileFileListSettingItem::SettingTextL
+// -----------------------------------------------------------------------------
+//
+const TDesC& CProfileFileListSettingItem::SettingTextL()
+    {
+    if( iInternalToneFileName->Length() > 0 )
+        {
+        // FLD has returned a filename
+        if( iInternalToneFileName->CompareF( *iNoSoundFileName ) == 0 )
+            {
+            // Filename is "No_Sound", return localized text "None"
+            iSettingText.Set( *iNoSoundText );
+            }
+        else
+            {
+            // Filename is something else
+            TParsePtrC parse( *iInternalToneFileName );
+            if( parse.Ext().CompareF( KIgnoredExtension ) == 0 )
+                {
+                iSettingText.Set( parse.Name() );
+                }
+            else
+                {
+                iSettingText.Set( parse.NameAndExt() );
+                }
+            }
+        }
+    else
+        {
+        // Filename is an empty descriptor, return localised text "None"
+        iSettingText.Set( *iNoSoundText );
+        }
+    return iSettingText;
+    }
+
+// End Of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileFileListSettingItem.h	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,135 @@
+/*
+* 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:  Setting item class for tone selection.
+*
+*/
+
+
+
+#ifndef CPROFILEFILELISTSETTINGITEM_H
+#define CPROFILEFILELISTSETTINGITEM_H
+
+// INCLUDES
+#include <aknsettingitemlist.h>
+
+// FORWARD DECLARATIONS
+class CCoeEnv;
+
+
+// CLASS DECLARATION
+/**
+*  Setting item class for tone selection.
+*  CProfileFileListSettingItem launches File List Dialog common component
+*  from which user can select a file for ringing tone.
+*
+*  @lib ProfileSettingsView.lib
+*  @since 1.2
+*/
+NONSHARABLE_CLASS( CProfileFileListSettingItem ) : public CAknSettingItem
+	{
+
+	public:		// Constructors and destructor
+
+		/**
+		* C++ constructor.
+		* @param aIdentifier Resource identifier.
+		*        Tells which setting item is currently edited.
+		* @param aToneFileName File name of the selected tone is stored here.
+		* @param aRingingType Describes how the tone is played.
+		* @param aRingingVolume The volume how loud the tone is played.
+		* @param aVibratingAlert Setting of the vibrating alert.
+		* @param aCoeEnv Pointer to Control Environment.
+		*/
+		CProfileFileListSettingItem(
+			TInt aIdentifier,
+			TDes& aToneFileName,
+			const TInt& aRingingType,
+			const TInt& aRingingVolume,
+			const TBool& aVibratingAlert,
+			TInt& a3DEffect,
+			TInt& a3DEcho,
+			CCoeEnv* aCoeEnv );
+
+        /**
+        * Destructor.
+        */
+		~CProfileFileListSettingItem();
+
+	private:	// Functions from base classes
+
+        /**
+        * From CAknSettingItem
+        */
+		void CompleteConstructionL();
+
+        /**
+        * From CAknSettingItem
+        */
+		void StoreL();
+
+        /**
+        * From CAknSettingItem
+        */
+		void LoadL();
+
+        /**
+        * From CAknSettingItem
+        */
+		void EditItemL( TBool aCalledFromMenu );
+
+        /**
+        * From CAknSettingItem
+        */
+		const TDesC& SettingTextL();
+
+
+	private:	// Data
+
+		// Internal buffer for filename of selected tone
+		TFileName* iInternalToneFileName;
+
+		// External filename for selected tone
+		TDes& iExternalToneFileName;
+
+		// Ringing type for tone playback
+		const TInt& iRingingType;
+
+		// Ringing volume for tone playback
+		const TInt& iRingingVolume;
+
+		// Vibrating alert setting for tone playback
+		const TBool& iVibratingAlert;
+
+		// Own: Localised text qtn_tc_none
+		HBufC* iNoSoundText;
+
+		// Own: "No_Sound.wav" file name
+		HBufC* iNoSoundFileName;
+
+		// Own: Localised text for title for tone selection
+		HBufC* iTitle; /// Title for tone selection
+
+		// Text that is returned by SettingTextL
+		TPtrC iSettingText;
+
+		TInt& i3DEffect;
+		TInt& i3DEcho;
+		// Ref: Pointer to Control Environment
+		CCoeEnv* iCoeEnv;
+
+	};
+
+#endif // CPROFILEFILELISTSETTINGITEM_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileIndexHandler.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,235 @@
+/*
+* 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 index handler (for use of Settings Container
+*                if multiple profiles are edited)
+*
+*/
+
+
+//  INCLUDES
+#include "CProfileIndexHandler.h"
+
+#include <MProfilesNamesArray.h>
+#include <eiklbx.h>
+
+#include "CProfileEngineHandler.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileIndexHandler::CProfileIndexHandler
+// C++ constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CProfileIndexHandler::CProfileIndexHandler(
+    CProfileEngineHandler& aEngineHandler )
+    :   iEngineHandler( aEngineHandler )
+    {
+    }
+
+void CProfileIndexHandler::ConstructL()
+    {
+    }
+
+EXPORT_C CProfileIndexHandler* CProfileIndexHandler::NewL(
+    CProfileEngineHandler& aEngineHandler )
+    {
+    CProfileIndexHandler* self =
+        new( ELeave ) CProfileIndexHandler( aEngineHandler );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+CProfileIndexHandler::~CProfileIndexHandler()
+    {
+    iIndexArray.Close();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileIndexHandler::CurrentProfileIndex
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CProfileIndexHandler::CurrentProfileIndex() const
+	{
+	return iCurrentProfileIndex;
+	}
+
+// -----------------------------------------------------------------------------
+// CProfileIndexHandler::SetCurrentProfileIndex
+// Note that there is no boundary checking.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CProfileIndexHandler::SetCurrentProfileIndex( TInt aIndex )
+	{
+	iCurrentProfileIndex = aIndex;
+	}
+
+// -----------------------------------------------------------------------------
+// CProfileIndexHandler::CreateIndexArrayL
+// Resets the index array and populates it with zeroes
+// -----------------------------------------------------------------------------
+//
+void CProfileIndexHandler::CreateIndexArrayL()
+    {
+    iIndexArray.Reset();
+    TItem item = { 0, 0 };
+    TInt count( iEngineHandler.IdArray()->MdcaCount() );
+    while( --count >= 0 )
+        {
+        User::LeaveIfError( iIndexArray.Append( item ) );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileIndexHandler::StoreIndices
+// -----------------------------------------------------------------------------
+//
+void CProfileIndexHandler::StoreIndices()
+    {
+    if( !iListBox )
+        {
+        return;
+        }
+
+    TItem& item = iIndexArray[iCurrentProfileIndex];
+    item.iIndex = iListBox->View()->CurrentItemIndex();
+    item.iTopIndex = iListBox->View()->TopItemIndex() - item.iIndex;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileIndexHandler::LoadIndices
+// -----------------------------------------------------------------------------
+//
+void CProfileIndexHandler::LoadIndices()
+    {
+    if( !iListBox )
+        {
+        return;
+        }
+
+    const TInt KMaxLastIndex( 2 ); // Three items fit to screen at the same time
+
+    TInt lastIndex( iListBox->Model()->MatchableTextArray()->MdcaCount() - 1 );
+
+    TItem item = iIndexArray[iCurrentProfileIndex];
+    if( item.iIndex > lastIndex )
+        {
+        item.iIndex = lastIndex;
+        }
+    if( item.iIndex < 0 )
+        {
+        item.iIndex = 0;
+        }
+    item.iTopIndex += item.iIndex;
+    if( item.iTopIndex > lastIndex - KMaxLastIndex )
+        {
+        item.iTopIndex = lastIndex - KMaxLastIndex;
+        }
+    if( item.iTopIndex < 0 )
+        {
+        item.iTopIndex = 0;
+        }
+
+    iListBox->View()->SetCurrentItemIndex( item.iIndex );
+    iListBox->View()->SetTopItemIndex( item.iTopIndex );
+    iListBox->DrawDeferred();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileIndexHandler::IndexAt
+// -----------------------------------------------------------------------------
+//
+TInt CProfileIndexHandler::IndexAt( TInt aIndex ) const
+    {
+    return iIndexArray[aIndex].iIndex;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileIndexHandler::TopIndexAt
+// -----------------------------------------------------------------------------
+//
+TInt CProfileIndexHandler::TopIndexAt( TInt aIndex ) const
+    {
+    return iIndexArray[aIndex].iTopIndex;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileIndexHandler::RemoveAndInsert
+// -----------------------------------------------------------------------------
+//
+TInt CProfileIndexHandler::RemoveAndInsert(
+    TInt aOldIndex, TInt aNewIndex, TInt aIndexValue, TInt aTopIndexValue )
+    {
+    TInt count( iIndexArray.Count() );
+    if( aOldIndex < 0 || aOldIndex >= count )
+        {
+        return KErrNotFound;
+        }
+    if( aNewIndex < 0 || aNewIndex > count )
+        {
+        return KErrArgument;
+        }
+    iIndexArray.Remove( aOldIndex );
+    TItem item = { aIndexValue, aTopIndexValue };
+    iIndexArray.Insert( item, aNewIndex );
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileIndexHandler::SetListBox
+// -----------------------------------------------------------------------------
+//
+void CProfileIndexHandler::SetListBox( CEikListBox* aListBox )
+    {
+    iListBox = aListBox;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileIndexHandler::ReadIdArrayAndUpdateL
+// -----------------------------------------------------------------------------
+//
+TInt CProfileIndexHandler::ReadIdArrayAndUpdateL()
+    {
+    // Index of the profile before the engine rearranges the profiles.
+    TInt oldProfileIndex( iCurrentProfileIndex );
+    
+    // ID of the profile so that we can find it after the engine
+    // rearranges the profiles.
+    TInt profileId( iEngineHandler.IdForIndex( oldProfileIndex ) );
+    
+    // Store the indices for edited profile.
+    StoreIndices();
+    
+    TInt newItemIndex( IndexAt( oldProfileIndex ) );
+    TInt newTopItemIndex( TopIndexAt( oldProfileIndex ) );
+
+    // Refresh profile names. Order of the profiles may change.
+    iEngineHandler.ReadIdArrayL();
+
+    // Find out which of the profiles is now the edited profile
+    TInt newProfileIndex( iEngineHandler.IdArray()->FindById( profileId ) );
+
+    // Set it to current profile
+    SetCurrentProfileIndex( newProfileIndex );
+    
+    // Update indices
+    User::LeaveIfError( RemoveAndInsert( oldProfileIndex, newProfileIndex,
+        newItemIndex, newTopItemIndex ) );
+
+    return newProfileIndex;
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileKeypadVolumeSettingItem.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  Setting item class for keypad volume setting.
+*
+*/
+
+
+
+// INCLUDES
+#include <AknUtils.h>
+
+#include "CProfileKeypadVolumeSettingItem.h"
+#include "CProfileKeypadVolumeSettingPage.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileKeypadVolumeSettingItem::CProfileKeypadVolumeSettingItem
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CProfileKeypadVolumeSettingItem::CProfileKeypadVolumeSettingItem(
+	TInt aIdentifier,
+	TInt& aValue,
+	CAknKeySoundSystem* aSoundSystem )
+	:	CAknEnumeratedTextPopupSettingItem( aIdentifier, aValue ),
+		iSoundSystem( aSoundSystem )
+	{
+	}
+
+// -----------------------------------------------------------------------------
+// CProfileKeypadVolumeSettingItem::CompleteConstructionL
+// -----------------------------------------------------------------------------
+//
+void CProfileKeypadVolumeSettingItem::CompleteConstructionL()
+	{
+	CAknEnumeratedTextPopupSettingItem::CompleteConstructionL();
+	CArrayPtr<CAknEnumeratedText>* array = EnumeratedTextArray();
+	TInt count( array->Count() );
+	HBufC* text = NULL;
+	while( count-- )
+		{
+		text = array->At( count )->Value();
+		TPtr modifiable( text->Des() );
+		AknTextUtils::LanguageSpecificNumberConversion( modifiable );
+		}
+	}
+
+// -----------------------------------------------------------------------------
+// CProfileKeypadVolumeSettingItem::CreateSettingPageL
+// -----------------------------------------------------------------------------
+//
+CAknSettingPage* CProfileKeypadVolumeSettingItem::CreateSettingPageL()
+	{
+	return new( ELeave ) CProfileKeypadVolumeSettingPage(
+		SettingPageResourceId(),
+		*QueryValue(),
+		iSoundSystem );
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileKeypadVolumeSettingItem.h	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,74 @@
+/*
+* 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:  Setting item class for keypad volume setting.
+*
+*/
+
+
+
+#ifndef CPROFILEKEYPADVOLUMESETTINGITEM_H
+#define CPROFILEKEYPADVOLUMESETTINGITEM_H
+
+// INCLUDES
+#include <aknsettingitemlist.h>
+
+// FORWARD DECLARATIONS
+class CAknSettingPage;
+class CAknKeySoundSystem;
+
+// CLASS DECLARATION
+/**
+*  Setting item class for keypad volume setting.
+*  CProfileKeypadVolumeSettingItem extends CAknEnumeratedTextPopupSettingItem
+*  in order to launch
+*  CProfileKeypadVolumeSettingPage instead of CAknPopupSettingPage.
+*
+*  @lib ProfileSettingsView.lib
+*  @since 1.2
+*/
+NONSHARABLE_CLASS( CProfileKeypadVolumeSettingItem )
+ : public CAknEnumeratedTextPopupSettingItem
+	{
+	public:		// Constructor
+
+        /**
+        * C++ constructor.
+        */
+		CProfileKeypadVolumeSettingItem(
+			TInt aIdentifier,
+			TInt& aValue,
+			CAknKeySoundSystem* aSoundSystem );
+
+	private:	// Functions from base classes
+
+        /**
+        * From CAknEnumeratedTextPopupSettingItem
+        */
+		void CompleteConstructionL();
+
+        /**
+        * From CAknEnumeratedTextPopupSettingItem
+        */
+		CAknSettingPage* CreateSettingPageL();
+
+	private:	// Data
+
+		// Ref: Pointer to AVKON key sound system
+		CAknKeySoundSystem* iSoundSystem;
+
+	};
+
+#endif // CPROFILEKEYPADVOLUMESETTINGITEM_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileKeypadVolumeSettingPage.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,198 @@
+/*
+* 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:  Setting page class for keypad volume setting.
+*
+*/
+
+
+
+// INCLUDES
+#include "CProfileKeypadVolumeSettingPage.h"
+
+#include <AudioPreference.h>
+#include <aknsoundsystem.h>
+#include <StringLoader.h>	// For StringLoader
+#include <aknnotewrappers.h> // For CAknInformationNote
+#include <profilesettingsview.rsg>
+
+// for power save mode handling
+#include <psmsettings.h>
+#include <psmsrvdomaincrkeys.h>
+#include <centralrepository.h>
+
+namespace
+	{
+// CONSTANTS
+#ifdef __WINS__
+	// These constants are for WINS only because sequences are not played in emulator.
+	const TInt KKeypadToneFrequency( 1760 ); /// In Hz
+	const TInt KKeypadToneDuration( 20000 ); /// In microseconds
+#endif // __WINS__
+	}
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileKeypadVolumeSettingPage::CProfileKeypadVolumeSettingPage
+// C++ constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CProfileKeypadVolumeSettingPage::CProfileKeypadVolumeSettingPage(
+	TInt aResourceID,
+	MAknQueryValue& aQueryValue,
+	CAknKeySoundSystem* aSoundSystem )
+	:	CAknPopupSettingPage( aResourceID, aQueryValue ),
+		iSoundSystem( aSoundSystem )
+	{
+	}
+
+// Destructor.
+CProfileKeypadVolumeSettingPage::~CProfileKeypadVolumeSettingPage()
+	{
+	if( iAudioUtility )
+		{
+		if( iAudioUtility->State() != EMdaAudioToneUtilityNotReady )
+			{
+			// Set volume back to original
+			iAudioUtility->SetVolume( iOriginalVolume );
+			}
+		delete iAudioUtility;
+		}
+	if( iSoundSystem )
+		{
+		// Re-enable keypad sounds
+		iSoundSystem->PopContext();
+		}
+	}
+
+// -----------------------------------------------------------------------------
+// CProfileKeypadVolumeSettingPage::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfileKeypadVolumeSettingPage::ConstructL()
+	{
+	User::LeaveIfNull( iSoundSystem );
+
+	CAknPopupSettingPage::ConstructL();
+
+	// Own construction starts here
+
+	// Disable keypad sounds
+	iSoundSystem->PushContextL( R_AVKON_SILENT_SKEY_LIST );
+
+	// Create audio player and prepare to play a tone
+	iAudioUtility = CMdaAudioToneUtility::NewL( *this );
+
+#ifdef __WINS__ // Sequences are not supported on emulator
+	iAudioUtility->PrepareToPlayTone( KKeypadToneFrequency,
+		TTimeIntervalMicroSeconds( KKeypadToneDuration ) );
+#else
+	CAknSoundInfo* soundInfo = CAknSoundInfo::NewL();
+	CleanupStack::PushL( soundInfo );
+	User::LeaveIfError( iSoundSystem->RequestSoundInfoL(
+		EAvkonSIDStandardKeyClick, *soundInfo ) );
+	iAudioUtility->PrepareToPlayDesSequence( *soundInfo->iSequence );
+	CleanupStack::PopAndDestroy( soundInfo );
+#endif // __WINS__
+	}
+
+
+// -----------------------------------------------------------------------------
+// CProfileKeypadVolumeSettingPage::OkToExitL
+// -----------------------------------------------------------------------------
+//
+TBool CProfileKeypadVolumeSettingPage::OkToExitL( TBool aAccept )
+    {
+    if( aAccept )
+        {
+        TInt psm = EPsmsrvModeNormal;
+        CRepository* cenrep = CRepository::NewLC( KCRUidPowerSaveMode );
+        cenrep->Get( KPsmCurrentMode, psm );
+        CleanupStack::PopAndDestroy( cenrep );
+        if( psm == EPsmsrvModePowerSave )
+            {
+            HBufC* buf = StringLoader::LoadLC( R_PROFILE_TEXT_PSM_INFONOTE );
+            CAknInformationNote* queryDialog = new (ELeave) CAknInformationNote( EFalse );
+         	queryDialog->ExecuteLD( *buf );
+            CleanupStack::PopAndDestroy( buf );
+            }
+        }
+    return ETrue;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileKeypadVolumeSettingPage::OfferKeyEventL
+// -----------------------------------------------------------------------------
+//
+TKeyResponse CProfileKeypadVolumeSettingPage::OfferKeyEventL(
+	const TKeyEvent& aKeyEvent, TEventCode aType )
+	{
+	// Cache pointer used multiple times
+	CAknSetStyleListBox* listBoxControl = ListBoxControl();
+	// Get current index from listbox
+	TInt oldIndex( listBoxControl->CurrentItemIndex() );
+	// Call OfferKeyEventL of base class
+	TKeyResponse response( CAknPopupSettingPage::OfferKeyEventL( aKeyEvent, aType ) );
+	// Get audio player state
+	TInt state( iAudioUtility->State() );
+	// Get new index from listbox
+	TInt newIndex( listBoxControl->CurrentItemIndex() );
+
+	if( ( oldIndex != newIndex ) && // check if listbox focus has changed
+		( newIndex != 0 ) && // check that new focus is not on first item "Off"
+		( state != EMdaAudioToneUtilityNotReady ) ) // check that tone player is ready
+		{
+		// Resolve last index of listbox
+		TInt lastIndex( listBoxControl->Model()->MatchableTextArray()->MdcaCount() - 1 );
+		// Resolve correct volume from current listbox index
+		TInt volume( iAudioUtility->MaxVolume() * newIndex / lastIndex );
+
+		if( state == EMdaAudioToneUtilityPlaying )
+			{
+			// Cancel play if still playing previous keyclick
+	        iAudioUtility->CancelPlay();
+			}
+		iAudioUtility->SetVolume( volume );
+		iAudioUtility->Play();
+		}
+	return response;
+	}
+
+// -----------------------------------------------------------------------------
+// CProfileKeypadVolumeSettingPage::MatoPrepareComplete
+// -----------------------------------------------------------------------------
+//
+void CProfileKeypadVolumeSettingPage::MatoPrepareComplete( TInt aError )
+	{
+	if( !aError )
+		{
+		// After prepare is completed, store original volume level
+		iOriginalVolume = iAudioUtility->Volume();
+		// Set priority
+		iAudioUtility->SetPriority( KAudioPriorityKeyPress,
+			TMdaPriorityPreference( KAudioPrefKeyPressPreview ) );
+		}
+	}
+
+// -----------------------------------------------------------------------------
+// CProfileKeypadVolumeSettingPage::MatoPlayComplete
+// Error ignored because if playing of the keypad tone is unsuccesful
+// nothing can be done.
+// -----------------------------------------------------------------------------
+//
+void CProfileKeypadVolumeSettingPage::MatoPlayComplete( TInt /*aError*/ )
+	{
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileKeypadVolumeSettingPage.h	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,103 @@
+/*
+* 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:  Setting page class for keypad volume setting.
+*
+*/
+
+
+
+#ifndef CPROFILEKEYPADVOLUMESETTINGPAGE_H
+#define CPROFILEKEYPADVOLUMESETTINGPAGE_H
+
+// INCLUDES
+#include <aknpopupsettingpage.h>
+#include <mdaaudiotoneplayer.h>
+
+// FORWARD DECLARATIONS
+class CAknKeySoundSystem;
+
+// CLASS DECLARATION
+/**
+*  Setting page class for keypad volume setting.
+*  CProfileKeypadVolumeSettingPage extends CAknPopupSettingPage in order to
+*  play a preview sound of the selected keypad volume when changing focus
+*  in the setting list.
+*
+*  @lib ProfileSettingsView.lib
+*  @since 1.2
+*/
+class CProfileKeypadVolumeSettingPage : public CAknPopupSettingPage
+									  , public MMdaAudioToneObserver
+	{
+	public:		// Constructors and destructor
+
+        /**
+        * C++ constructor.
+        * @param aResourceID Setting page resource id.
+        * @param aQueryValue
+        * @param aSoundSystem Pointer to AVKON key sound system.
+        */
+		CProfileKeypadVolumeSettingPage(
+			TInt aResourceID,
+			MAknQueryValue& aQueryValue,
+			CAknKeySoundSystem* aSoundSystem );
+
+		/**
+		* Destructor.
+		*/
+		~CProfileKeypadVolumeSettingPage();
+
+		/**
+		* Symbian 2nd phase constructor.
+		*/
+		void ConstructL();
+
+	private:	// Function from base classes
+
+        /**
+        * From CCoeControl
+        */
+		TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
+
+        /**
+        * From CAknSettingPage
+        */
+		TBool OkToExitL( TBool aAccept );
+
+		/**
+        * From MMdaAudioToneObserver
+        */
+		void MatoPrepareComplete( TInt aError );
+
+        /**
+        * From MMdaAudioToneObserver
+        */
+		void MatoPlayComplete( TInt aError );
+
+	private:	// Data
+
+		// Ref: Pointer to AVKON key sound system.
+		CAknKeySoundSystem* iSoundSystem;
+
+		// Own: Media client to play audio.
+		CMdaAudioToneUtility* iAudioUtility;
+
+		// Original volume value.
+		TInt iOriginalVolume;
+
+	};
+
+#endif // CPROFILEKEYPADVOLUMESETTINGPAGE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileNameSettingItem.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  Setting item class for profile name setting.
+*
+*/
+
+
+
+// INCLUDES
+#include "CProfileNameSettingItem.h"
+#include "CProfileNameSettingPage.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileNameSettingItem::CProfileNameSettingItem
+// C++ constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CProfileNameSettingItem::CProfileNameSettingItem(
+	TInt aIdentifier,
+	TDes& aText,
+	CProfileEngineHandler& aEngineHandler )
+	:	CAknTextSettingItem( aIdentifier, aText ),
+		iEngineHandler( aEngineHandler )
+	{
+	}
+
+// -----------------------------------------------------------------------------
+// CProfileNameSettingItem::EditItemL
+// We do not need to know if the setting page has been launched
+// with selection key or from Options menu.
+// -----------------------------------------------------------------------------
+//
+void CProfileNameSettingItem::EditItemL( TBool /* aCalledFromMenu */ )
+	{
+	CProfileNameSettingPage* dlg = new( ELeave ) CProfileNameSettingPage(
+		SettingPageResourceId(),
+		InternalTextPtr(),
+		SettingPageFlags(),
+        iEngineHandler );
+	SetSettingPage( dlg );
+	dlg->SetSettingPageObserver( this );
+	dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged );
+	SetSettingPage( NULL ); // it is deleted now
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileNameSettingItem.h	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  Setting item class for profile name setting.
+*
+*/
+
+
+
+#ifndef CPROFILENAMESETTINGITEM_H
+#define CPROFILENAMESETTINGITEM_H
+
+// INCLUDES
+#include <aknsettingitemlist.h>
+
+// FORWARD DECLARATIONS
+class CProfileEngineHandler;
+
+// CLASS DECLARATION
+/**
+*  Setting item class for profile name setting.
+*  CProfileNameSettingItem extends CAknTextSettingItem in order to launch
+*  CProfileNameSettingPage instead of CCAknTextSettingPage.
+*
+*  @lib ProfileSettingsView.lib
+*  @since 1.2
+*/
+NONSHARABLE_CLASS( CProfileNameSettingItem ) : public CAknTextSettingItem
+	{
+	public:		// Constructor
+
+		/**
+		* C++ constructor.
+		* @param aIdentifier Setting item identifier.
+		* @param aText A descriptor where new profile name is stored.
+		* @param aEngineHandler Profile Engine Handler.
+		*/
+		CProfileNameSettingItem(
+			TInt aIdentifier,
+			TDes& aText,
+			CProfileEngineHandler& aEngineHandler );
+
+	private:	// Functions from base classes
+
+        /**
+        * From CAknSettingItem
+        */
+		void EditItemL( TBool aCalledFromMenu );
+
+	private:	// Data
+
+		// Profile Engine Handler.
+		CProfileEngineHandler& iEngineHandler;
+
+	};
+
+#endif // CPROFILENAMESETTINGITEM_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileNameSettingPage.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,85 @@
+/*
+* 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:  Setting page class for profile name setting.
+*
+*/
+
+
+
+// INCLUDES
+#include    "CProfileNameSettingPage.h"
+
+#include    <aknnotewrappers.h>
+#include    <MProfilesNamesArray.h>
+#include    <profilesettingsview.rsg>
+#include	<StringLoader.h>
+
+#include    "CProfileEngineHandler.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileNameSettingPage::CProfileNameSettingPage
+// C++ constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CProfileNameSettingPage::CProfileNameSettingPage(
+    TInt aResourceID,
+    TDes& aText,
+    TInt aTextSettingPageFlags,
+    CProfileEngineHandler& aEngineHandler )
+    :   CAknTextSettingPage( aResourceID, aText, aTextSettingPageFlags ),
+        iEngineHandler( aEngineHandler ),
+        iOriginalText( aText )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileNameSettingPage::OkToExitL
+// -----------------------------------------------------------------------------
+//
+TBool CProfileNameSettingPage::OkToExitL( TBool aAccept )
+    {
+    if( aAccept )
+        {
+        CEikEdwin* edwin = TextControl();
+        TBuf<KProfileMaxProfileNameLength> editedName;
+        edwin->GetText( editedName );
+
+        if( editedName.Compare( iOriginalText ) == 0 )
+            {
+            return ETrue;
+            }
+        if( iEngineHandler.IdArray()->FindByName( editedName ) != KErrNotFound )
+            {
+            // A profile was found that has the same name which user just entered
+            // and it isn't the currently modified profile
+
+            // Show error note
+            HBufC* errorText = StringLoader::LoadLC( R_PROFILE_TEXT_RENAME_ERROR );
+            CAknErrorNote* note = new( ELeave ) CAknErrorNote( ETrue );
+            note->ExecuteLD( *errorText );
+            CleanupStack::PopAndDestroy( errorText );
+
+            // Set original text to editor
+            edwin->SetTextL( &iOriginalText );
+
+            // Don't let the setting page exit
+            return EFalse;
+            }
+        }
+    return ETrue;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileNameSettingPage.h	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  Setting page class for profile name setting.
+*
+*/
+
+
+
+#ifndef CPROFILENAMESETTINGPAGE_H
+#define CPROFILENAMESETTINGPAGE_H
+
+// INCLUDES
+#include "CProfileStruct.h" // KProfileMaxProfileNameLength
+#include <akntextsettingpage.h>
+
+// FORWARD DECLARATIONS
+class CProfileEngineHandler;
+
+// CLASS DECLARATION
+/**
+*  Setting page class for profile name setting.
+*  CProfileNameSettingPage extends CAknTextSettingPage in order to check
+*  validity of user typed profile name.
+*  Error note is shown if entered profile name already exists.
+*
+*  @lib ProfileSettingsView.lib
+*  @since 1.2
+*/
+NONSHARABLE_CLASS( CProfileNameSettingPage ) : public CAknTextSettingPage
+	{
+	public:		// Constructors and destructor
+
+		/**
+		* C++ constructor.
+		* @param aResourceID Setting page resource ID.
+		* @param aText The new profile name will be stored here.
+		* @param aTextSettingPageFlags Flags for the setting page.
+        * @param aEngineHandler Profile Engine Handler.
+		*/
+		CProfileNameSettingPage(
+			TInt aResourceID,
+			TDes& aText,
+			TInt aTextSettingPageFlags,
+            CProfileEngineHandler& aEngineHandler );
+
+	private:	// Functions from base classes
+
+        /**
+        * From CAknSettingPage
+        */
+		TBool OkToExitL( TBool aAccept );
+
+	private:	// Data
+
+		/// Profile Engine Handler;
+		CProfileEngineHandler& iEngineHandler;
+
+        /// The original profile name
+		TBuf<KProfileMaxProfileNameLength> iOriginalText;
+
+	};
+
+#endif // CPROFILENAMESETTINGPAGE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileNaviPaneContainer.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  Container for navi pane decorator.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "CProfileNaviPaneContainer.h"
+
+#include    <aknnavide.h>
+#include    <aknnavilabel.h>
+#include    <eikspane.h>
+#include    <avkon.hrh> // EEikStatusPaneUidNavi
+#include    <AknUtils.h> // AknTextUtils
+#include    <MProfilesNamesArray.h>
+#include    <MProfileEngineExtended.h>
+#include    <MProfileName.h>
+
+#include    "CProfileEngineHandler.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileNaviPaneContainer::CProfileNaviPaneContainer
+// C++ constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CProfileNaviPaneContainer::CProfileNaviPaneContainer(
+    CProfileEngineHandler& aEngineHandler )
+    :   iEngineHandler( aEngineHandler )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileNaviPaneContainer::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfileNaviPaneContainer::ConstructL( CEikStatusPane& aStatusPane )
+    {
+    iNaviPane = static_cast< CAknNavigationControlContainer* >(
+        aStatusPane.ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) );
+    iNaviDecorator = iNaviPane->CreateNavigationLabelL();
+    iNaviPane->PushL( *iNaviDecorator );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileNaviPaneContainer::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CProfileNaviPaneContainer* CProfileNaviPaneContainer::NewL(
+    CEikStatusPane& aStatusPane, CProfileEngineHandler& aEngineHandler )
+    {
+    CProfileNaviPaneContainer* self =
+        new( ELeave ) CProfileNaviPaneContainer( aEngineHandler );
+    CleanupStack::PushL( self );
+    self->ConstructL( aStatusPane );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// Destructor
+CProfileNaviPaneContainer::~CProfileNaviPaneContainer()
+    {
+   	Release();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileNaviPaneContainer::SetNaviPaneTextL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CProfileNaviPaneContainer::SetNaviPaneTextL( const TDesC& aText )
+    {
+    CAknNaviLabel* label = static_cast< CAknNaviLabel* >(
+        iNaviDecorator->DecoratedControl() );
+    RBuf title;
+    title.CreateL( aText );
+    CleanupClosePushL( title );
+    AknTextUtils::DisplayTextLanguageSpecificNumberConversion( title );
+    label->SetTextL( title );
+    CleanupStack::PopAndDestroy( &title );
+    label->DrawDeferred();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileNaviPaneContainer::SetNaviPaneTextL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CProfileNaviPaneContainer::SetNaviPaneTextL()
+    {
+    iEngineHandler.ReadIdArrayL();
+    MProfilesNamesArray* nameArray = iEngineHandler.IdArray();
+    TInt index( nameArray->FindById( iEngineHandler.Engine()->ActiveProfileId() ) );
+    SetNaviPaneTextL( nameArray->ProfileName( index )->NaviName() );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileNaviPaneContainer::SetNaviPaneTextL
+// -----------------------------------------------------------------------------
+//
+void CProfileNaviPaneContainer::Release()
+    {
+  	if( iNaviDecorator )
+        {
+        iNaviPane->Pop( iNaviDecorator );
+        delete iNaviDecorator;
+        iNaviDecorator = NULL;
+        }
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfilePlayingVolumeSettingItem.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,65 @@
+/*
+* 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:  Setting item class for ringing volume setting.
+*
+*/
+
+
+
+// INCLUDES
+#include "CProfilePlayingVolumeSettingItem.h"
+#include "CProfilePlayingVolumeSettingPage.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfilePlayingVolumeSettingItem::CProfilePlayingVolumeSettingItem
+// C++ constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CProfilePlayingVolumeSettingItem::CProfilePlayingVolumeSettingItem(
+	TInt aIdentifier,
+	TInt& aRingingVolume,
+	const TDesC& aRingingTone,
+	const TInt& aRingingType,
+	const TBool& aVibratingAlert,
+	const TBool aDisplayQuery )
+	:	CAknVolumeSettingItem( aIdentifier, aRingingVolume ),
+		iRingingTone( aRingingTone ),
+		iRingingType( aRingingType ),
+		iVibratingAlert( aVibratingAlert ),
+		iDisplayQuery( aDisplayQuery )
+	{
+	}
+
+// -----------------------------------------------------------------------------
+// CProfilePlayingVolumeSettingItem::EditItemL
+// -----------------------------------------------------------------------------
+//
+void CProfilePlayingVolumeSettingItem::EditItemL( TBool /* aCalledFromMenu */ )
+	{
+	CProfilePlayingVolumeSettingPage* dlg = new( ELeave ) CProfilePlayingVolumeSettingPage(
+		SettingPageResourceId(),
+		InternalVolumeValue(),
+		iRingingTone,
+		iRingingType,
+		iVibratingAlert,
+		iDisplayQuery );
+	SetSettingPage( dlg );
+	SettingPage()->SetSettingPageObserver( this );
+    SettingPage()->ExecuteLD();
+	SetSettingPage( NULL );
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfilePlayingVolumeSettingItem.h	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  Setting item class for ringing volume setting.
+*
+*/
+
+
+
+#ifndef CPROFILEPLAYINGVOLUMESETTINGITEM_H
+#define CPROFILEPLAYINGVOLUMESETTINGITEM_H
+
+// INCLUDES
+#include <aknsettingitemlist.h>
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+/**
+*  Setting item class for ringing volume setting.
+*  CProfilePlayingVolumeSettingItem extends CAknVolumeSettingItem
+*  in order to launch CProfilePlayingVolumeSettingPage
+*  instead of CAknVolumeSettingPage.
+*
+*  @lib ProfileSettingsView.lib
+*  @since 1.2
+*/
+NONSHARABLE_CLASS( CProfilePlayingVolumeSettingItem ) : public CAknVolumeSettingItem
+	{
+	public:		// Constructors and destructor
+
+        /**
+        * C++ constructor.
+        * @param aIdentifier Setting item identifier.
+        * @param aRingingVolume Ringing volume.
+        * @param aRingingTone Ringing tone.
+        * @param aRingingType Ringint type.
+        * @param aVibratingAlert Vibrating alert.
+        * @param aDisplayQuery Information of whether 
+		* CProfilePlayingVolumeSettingPage
+		* should display confirmation note
+		* when setting maximum volume
+        */
+		CProfilePlayingVolumeSettingItem(
+			TInt aIdentifier,
+			TInt& aRingingVolume,
+			const TDesC& aRingingTone,
+			const TInt& aRingingType,
+			const TBool& aVibratingAlert,
+			const TBool aDisplayQuery );
+
+	private:	// Functions from base classes
+
+        /**
+        * From CAknVolumeSettingItem
+        */
+		void EditItemL( TBool aCalledFromMenu );
+
+	private:	// Data
+
+		// Ringing tone.
+		const TDesC& iRingingTone;
+
+		// Ringing type.
+		const TInt& iRingingType;
+
+		// Vibrating alert.
+		const TBool& iVibratingAlert;
+		
+		// Display confirmation note.
+		const TBool iDisplayQuery;
+
+	};
+
+#endif // CPROFILEPLAYINGVOLUMESETTINGITEM_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfilePlayingVolumeSettingPage.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,250 @@
+/*
+* 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:  Setting page class for ringing volume setting.
+*
+*/
+
+
+
+// INCLUDES
+#include "CProfilePlayingVolumeSettingPage.h"
+
+#include <AknQueryDialog.h>
+#include <CFLDController.h>
+#include <profilesettingsview.rsg>
+#include "CProfileStruct.h" // KProfileMaxProfileNameLength
+#include <apgcli.h>	// For RApaLsSession
+#include <bautils.h> // For BaflUtils
+#include <centralrepository.h>
+#include <ProfileEngineInternalCRKeys.h>
+
+// CONSTANTS
+namespace
+	{
+	const TInt KRepeatDelayInMicroSeconds( 1000000 ); // One second
+
+#ifdef RD_VIDEO_AS_RINGING_TONE
+	_LIT( KFLDCommonVideoType, "video/*" );
+	_LIT( KFLDRM1VideoMimeType, "application/vnd.rn-realmedia" );
+	_LIT( KFLDRM2VideoMimeType, "application/x-pn-realmedia" );
+	_LIT( KFLDSDPVideoMimeType, "application/sdp" );
+#endif
+
+	}
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfilePlayingVolumeSettingPage::CProfilePlayingVolumeSettingPage
+// C++ constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CProfilePlayingVolumeSettingPage::CProfilePlayingVolumeSettingPage(
+    TInt aResourceID,
+    TInt& aVolume,
+    const TDesC& aRingingTone,
+    const TInt& aRingingType,
+    const TBool& aVibratingAlert,
+    TBool aDisplayQuery )
+    :   CAknVolumeSettingPage( aResourceID, aVolume ),
+        iRingingTone( aRingingTone ),
+        iRingingType( aRingingType ),
+        iVibratingAlert( aVibratingAlert ),
+        iDisplayQuery( aDisplayQuery )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilePlayingVolumeSettingPage::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfilePlayingVolumeSettingPage::ConstructL()
+    {
+    CAknVolumeSettingPage::ConstructL();
+	TBool showErrorMsgs( EFalse );
+	
+    iFs = new ( ELeave ) RFs;
+    User::LeaveIfError( iFs->Connect() );
+
+	CheckRingingToneTypeL();
+
+    iController = CFLDController::NewL( showErrorMsgs, KRepeatDelayInMicroSeconds );
+	iController->CompleteConstructionL( Window() );
+	iController->SetRingingType( iRingingType );
+	iController->SetVibra( iVibratingAlert );
+    }
+
+// Destructor.
+CProfilePlayingVolumeSettingPage::~CProfilePlayingVolumeSettingPage()
+    {
+    if( iFs )
+    	{
+    	iFs->Close();
+    	}
+    delete iFs;
+    delete iController;
+    delete iPreviewTone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilePlayingVolumeSettingPage::OfferKeyEventL
+// -----------------------------------------------------------------------------
+//
+TKeyResponse CProfilePlayingVolumeSettingPage::OfferKeyEventL(
+    const TKeyEvent& aKeyEvent, TEventCode aType )
+    {
+    if( aType == EEventKey )
+        {
+        if( ( aKeyEvent.iCode == EKeyLeftArrow ) ||
+            ( aKeyEvent.iCode == EKeyRightArrow ) )
+            {
+            // Cache pointer
+            CAknVolumeControl* volumeControl = VolumeControl();
+            // Get current volume level
+            TInt currentVolume( volumeControl->Value() );
+            // Call base classes method
+            TKeyResponse response( CAknVolumeSettingPage::OfferKeyEventL( aKeyEvent, aType ) );
+            // Get new volume level
+            TInt newVolume( volumeControl->Value() );
+            if( newVolume != currentVolume )
+                {
+                // Volume level has changed
+                CheckRingingToneTypeL();
+                iController->SetVolume( newVolume );
+                iController->HandleFileListBoxEventL(
+                    MFLDFileListBoxObserver::EFocusChanged, iPreviewTone->Des() );
+                }
+            return response;
+            }
+        // Cancels playback on any key event
+        iController->HandleFileListBoxEventL(
+            MFLDFileListBoxObserver::EOtherKeyEvent, iPreviewTone->Des() );
+        }
+    return CAknVolumeSettingPage::OfferKeyEventL( aKeyEvent, aType );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfilePlayingVolumeSettingPage::HandlePointerEventL
+// -----------------------------------------------------------------------------
+//
+void CProfilePlayingVolumeSettingPage::HandlePointerEventL(
+    const TPointerEvent& aPointerEvent )
+    {
+    if( aPointerEvent.iType == TPointerEvent::EButton1Down )
+        {
+        // Get current volume level
+        iTempVolume = VolumeControl()->Value();
+        }
+    else if( aPointerEvent.iType == TPointerEvent::EButton1Up )
+    	{
+	    CAknVolumeSettingPage::HandlePointerEventL( aPointerEvent );
+        // Get new volume level
+        TInt newVolume( VolumeControl()->Value() );
+        if( newVolume != iTempVolume )
+            {
+            // Volume level has changed
+            CheckRingingToneTypeL();
+            iController->SetVolume( newVolume );
+            iController->HandleFileListBoxEventL(
+                MFLDFileListBoxObserver::EFocusChanged, iPreviewTone->Des() );
+            }
+        return;
+        }
+    // Cancels playback on any key event
+    iController->HandleFileListBoxEventL(
+        MFLDFileListBoxObserver::EOtherKeyEvent, iPreviewTone->Des() );
+
+    CAknVolumeSettingPage::HandlePointerEventL( aPointerEvent );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfilePlayingVolumeSettingPage::OkToExitL
+// -----------------------------------------------------------------------------
+//
+TBool CProfilePlayingVolumeSettingPage::OkToExitL(TBool aAccept)
+    {
+    if( aAccept )
+        {
+        CAknVolumeControl* volumeControl = VolumeControl();
+        if(( volumeControl->Value() == KProfileMaxVolumeLevel ) // Maximum volume level
+        && (iDisplayQuery)) // Maximum volume query is wanted
+            {
+            iController->HandleFileListBoxEventL(
+                MFLDFileListBoxObserver::EListBoxClosed, KNullDesC );
+
+            CAknQueryDialog* dlg = CAknQueryDialog::NewL();
+            TBool returnValue( dlg->ExecuteLD( R_PROFILE_VOLUME_CONFIRMATION_QUERY ) );
+            if( !returnValue )
+                {
+                // User didn't want to set volume to maximum level, set it one down.
+                volumeControl->SetValue( KProfileMaxVolumeLevel - 1 );
+                volumeControl->DrawDeferred();
+                }
+            return returnValue;
+            }
+        }
+    return ETrue;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilePlayingVolumeSettingPage::CheckRingingToneTypeL
+// -----------------------------------------------------------------------------
+//
+void CProfilePlayingVolumeSettingPage::CheckRingingToneTypeL()
+	{
+	// Get default tone from cenrep
+	TFileName defaultTone;
+	CRepository* cenrep = CRepository::NewL( KCRUidProfileEngine );
+	CleanupStack::PushL( cenrep );
+	User::LeaveIfError( cenrep->Get( KProEngDefaultRingingTone, defaultTone ) );
+	CleanupStack::PopAndDestroy( cenrep );
+
+	if( !BaflUtils::FileExists( *iFs, iRingingTone ) )
+		{
+		// If the file does not exist, use default tone for volume preview
+		iPreviewTone = defaultTone.AllocL();
+		return;
+		}
+
+#ifdef RD_VIDEO_AS_RINGING_TONE
+	// Find out MIME type
+	RApaLsSession apaLsSession;
+	User::LeaveIfError( apaLsSession.Connect() );
+	CleanupClosePushL( apaLsSession );
+	TUid dummyUid = { 0 }; // instantiate as zero
+	TDataType dataType( dummyUid );
+	User::LeaveIfError(
+		apaLsSession.AppForDocument( iRingingTone, dummyUid, dataType ) );
+	CleanupStack::PopAndDestroy(); // apaLsSession.Close()
+
+	// See if this is a video MIME type
+	if ( dataType.Des().MatchF( KFLDCommonVideoType ) == 0 ||
+		dataType.Des().CompareF( KFLDRM1VideoMimeType ) == 0 ||
+		dataType.Des().CompareF( KFLDRM2VideoMimeType ) == 0 ||
+		dataType.Des().CompareF( KFLDSDPVideoMimeType ) == 0 )
+		{
+		iPreviewTone = defaultTone.AllocL();
+		}
+	else
+		{
+		iPreviewTone = iRingingTone.AllocL();
+		}
+#else
+	iPreviewTone = iRingingTone.AllocL();
+#endif
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfilePlayingVolumeSettingPage.h	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,122 @@
+/*
+* 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:  Setting page class for ringing volume setting.
+*
+*/
+
+
+
+#ifndef CPROFILEPLAYINGVOLUMESETTINGPAGE_H
+#define CPROFILEPLAYINGVOLUMESETTINGPAGE_H
+
+// INCLUDES
+#include <aknvolumesettingpage.h>
+
+// FORWARD DECLARATIONS
+class CFLDController;
+
+// CLASS DECLARATION
+/**
+*  Setting page class for ringing volume setting.
+*  CProfilePlayingVolumeSettingPage extends CAknVolumeSettingPage in order to
+*  play a ringing tone at selected volume and to show a confirmation query
+*  if user selects the highest volume level.
+*
+*  @lib ProfileSettingsView.lib
+*  @since 1.2
+*/
+NONSHARABLE_CLASS( CProfilePlayingVolumeSettingPage ) : public CAknVolumeSettingPage
+	{
+	public:		// Constructors and destructor
+
+        /**
+        * C++ constructor.
+        * @param aResourceID Setting page resource ID.
+        * @param aVolume Selected ringing tone will be stored here.
+        * @param aRingingTone Ringing tone.
+        * @param aRingingType Ringing type.
+        * @param aVibratingAlert Vibrating alert.
+        * @param aDisplayQuery Info whether to show
+        * maximum volume query if volume is set to max
+        */
+		CProfilePlayingVolumeSettingPage(
+			TInt aResourceID,
+			TInt& aVolume,
+			const TDesC& aRingingTone,
+			const TInt& aRingingType,
+			const TBool& aVibratingAlert,
+			const TBool aDisplayQuery );
+
+        /**
+        * Symbian 2nd phase constructor.
+        */
+		void ConstructL();
+
+		/**
+		* Destructor.
+		*/
+		~CProfilePlayingVolumeSettingPage();
+
+	private:	// Functions from base classes
+
+        /**
+        * From CCoeControl
+        */
+		TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
+		void HandlePointerEventL(const TPointerEvent& aPointerEvent);
+
+        /**
+        * From CAknSettingPage
+        */
+		TBool OkToExitL(TBool aAccept);
+
+	private:	// New functions
+	
+		/**
+		* Checks if ringing tone is video and if so, sets default tone
+		*/
+		void CheckRingingToneTypeL();
+
+	private:	// Data
+
+		// Ringing tone.
+		const TDesC& iRingingTone;
+
+		// Ringing type.
+		const TInt& iRingingType;
+
+		// Vibrating alert.
+		const TBool& iVibratingAlert;
+
+		// Own: File List Dialog
+		CFLDController* iController;
+		
+		// Information of whether to display
+		// maximum volume query dialog
+		const TBool iDisplayQuery;
+
+		// Preview tone: either ringing tone or default tone
+		HBufC* iPreviewTone;
+
+        // Fileserver session
+        RFs* iFs;
+        
+        // Temporary volume value
+        TInt iTempVolume;
+
+	};
+
+#endif // CPROFILEPLAYINGVOLUMESETTINGPAGE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileSettingsContainer.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,1543 @@
+/*
+* 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:  Container class of settings view.
+*
+*/
+
+
+
+// CLASS HEADER
+#include    "CProfileSettingsContainer.h"
+
+// INTERNAL INCLUDES
+#include    "CProfileEngineHandler.h"
+#include    "CProfileIndexHandler.h"
+#include    "CProfileTabHandler.h"
+#include    "ProfileSettingsView.hrh"
+#include    "CProfile3dSettingItem.h"
+#include    "CProfileFeedbackSettingItem.h"
+#include    "CProfileVibraSettingItem.h"
+#include    "CProfilePlayingVolumeSettingItem.h"
+#include    "CProfileNameSettingItem.h"
+#include    "CProfileKeypadVolumeSettingItem.h"
+#include    "CProfileFileListSettingItem.h"
+#include    "CProfileAlertForSettingItem.h"
+#include    "CProfileStruct.h"
+#include    "MProfilesLocalFeatures.h"
+#include    "ProfilesVariant.hrh"  // KProEngFeatureIdVTRingingTone
+#include	"CProfileSettingsView.h"
+#include	"MProfileViewHandler.h" 
+#include    "ProfilesDebug.h"
+
+// EXTERNAL INCLUDES
+#include 	<AknDef.h>
+#include    <aknview.h>
+#include    <akntitle.h>
+#include    <akntextsettingpage.h>
+#include    <aknsoundsystem.h>
+#include    <eikapp.h>
+#include    <csxhelp/mode.hlp.hrh>
+#include    <featmgr.h>
+#include    <MProfileExtended.h>
+
+#include    <MProfileTones.h>
+#include    <MProfile3DToneSettings.h>
+#include    <MProfileFeedbackSettings.h>
+#include    <MProfileExtraSettings.h>
+
+#include    <MProfileEngineExtended.h>
+#include    <MProfilesNamesArray.h>
+#include    <MProfileName.h>
+#include    <CProfileChangeNotifyHandler.h>
+#include    <profilesettingsview.rsg>
+#include 	<data_caging_path_literals.hrh>
+#include 	<centralrepository.h>
+#include    <settingsinternalcrkeys.h>
+#include	<bautils.h>	// For BaflUtils
+#include	<StringLoader.h>	// For StringLoader
+#include	<ProfileEngineSDKCRKeys.h>	// For KCRUidProfileEngine
+#include	<ProfileEngineInternalCRKeys.h>	// For KProEngDefaultRingingTone
+#include	<AknQueryDialog.h>	// For CAknQueryDialog
+#include    "CProfileNaviPaneContainer.h" // For CProfileNaviPaneContainer
+#include    <aknnotewrappers.h> // For CAknInformationNote
+
+// for power save mode handling
+#include    <psmsettings.h>
+#include    <psmsrvdomaincrkeys.h>
+#include    <e32property.h>
+#include    <ProfileEnginePrivatePSKeys.h>
+#include    <TProfileToneSettings.h>
+
+namespace
+	{
+	// CONSTANTS
+	const TUid KUidProfileApp = { 0x100058F8 }; // UID of the application
+	const TInt KVoIPOFF = 0;
+
+	const TInt KFileCheckDelay = 100000; // microseconds
+	const TInt KFileCheckInterval = 5000000;
+
+	_LIT( KSettingsViewResourceFileName, "z:PROFILESETTINGSVIEW.RSC" );
+
+	}
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsContainer::CProfileSettingsContainer
+// C++ constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CProfileSettingsContainer::CProfileSettingsContainer(
+    MProfileViewHandler& aProfileViewHandler,
+    CProfileEngineHandler& aEngineHandler,
+    MProfileExternalSettingsHandler& aExternalSettingsHandler,
+    CProfileIndexHandler* aIndexHandler,
+    CProfileTabHandler* aTabHandler,
+    CAknTitlePane* aTitlePane )
+    :
+    iResourceLoader( *iCoeEnv ),
+    iProfileViewHandler( aProfileViewHandler ),
+    iEngineHandler( aEngineHandler ),
+    iExternalSettingsHandler( aExternalSettingsHandler ),
+    iIndexHandler( aIndexHandler ),
+    iTabHandler( aTabHandler ),
+    iTitlePane( aTitlePane ),
+    iAlternateLineService( EFalse )
+    {
+    SetMopParent( &( iProfileViewHandler.View() ) );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsContainer::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfileSettingsContainer::ConstructL( const TRect& aRect,
+                                            TInt aResourceId )
+    {
+    iFs = new ( ELeave ) RFs;
+    User::LeaveIfError( iFs->Connect() );
+
+    PRODEBUG1( "CProfileSettingsContainer ConstructL(%d)",aResourceId );
+    if( iIndexHandler )
+        {
+        iIndexHandler->CreateIndexArrayL();
+        }
+
+    iCopyProfile = CProfileStruct::NewL();
+
+    iLocalFeatures = &( iEngineHandler.Engine()->LocalFeatures() );
+
+    // Read settings of currently selected profile
+    ReadProfileL();
+
+    // Read alternate line service setting and register as observer
+    if( iSSSettings.Open() == KErrNone )
+        {
+        iSSSettings.Register( ESSSettingsAls, *this ); // ignore return value
+        TInt als( ESSSettingsAlsNotSupported );
+        iSSSettings.Get( ESSSettingsAls, als ); // ignore return value
+        if( als != ESSSettingsAlsNotSupported )
+            {
+            iAlternateLineService = ETrue;
+            }
+        }
+
+	// CRepository session for TTS ringingtone
+	iTTSSession = CRepository::NewL( KCRUidProfilesLV );
+	
+	iDefaultTone = new( ELeave ) TFileName();
+	
+    iSession = CRepository::NewL(KCRUidProfileEngine);
+    User::LeaveIfError( iSession->Get( KProEngDefaultRingingTone, *iDefaultTone ) );
+
+	TInt VoIPSupported( 0 );
+	iVoIPVariation = CRepository::NewL( KCRUidTelephonySettings );
+	iVoIPVariation->Get( KDynamicVoIP, VoIPSupported );
+	iVoIPVariationNotifier = CCenRepNotifyHandler::NewL( *this, *iVoIPVariation,
+        CCenRepNotifyHandler::EIntKey, KDynamicVoIP );
+    iVoIPVariationNotifier->StartListeningL();
+  
+    iVoIPStatus = KVoIPOFF != VoIPSupported;
+
+    iKeySounds = static_cast< CAknAppUi* > ( iEikonEnv->AppUi() )->KeySounds();
+
+	TParse* fp = new(ELeave) TParse();
+	fp->Set(KSettingsViewResourceFileName, &KDC_RESOURCE_FILES_DIR, NULL);
+	TFileName resourceFileName( fp->FullName() );
+	delete fp;
+
+	iResourceLoader.OpenL( resourceFileName );
+
+    // Construct the setting items
+    CAknSettingItemList::ConstructFromResourceL( aResourceId );
+    // Hide all items that must be hidden
+    SetHiddenFlagsL();
+
+    if( iIndexHandler )
+        {
+        iIndexHandler->SetListBox( ListBox() );
+        }
+    if( iTabHandler )
+        {
+        iTabHandler->SetTabObserver( this );
+        }
+    else
+        {
+        // If the iTabHandler is NULL, set the navi label text to 
+        // the name of current profile.
+        iNaviPaneContainer = CProfileNaviPaneContainer::NewL(
+                *( iAvkonAppUi->StatusPane() ), iEngineHandler );
+
+        MProfilesNamesArray* nameArray = iEngineHandler.IdArray();
+        if( iIndexHandler )
+            {
+            iNaviPaneContainer->SetNaviPaneTextL( 
+                nameArray->MdcaPoint( iIndexHandler->CurrentProfileIndex() ) );
+            }
+        }
+
+    iNotifier = CProfileChangeNotifyHandler::NewL( this );
+
+    iExternalSettingsHandler.SetObserver( *this );
+    SetRect( aRect );
+    ActivateL();
+    PRODEBUG1( "CProfileSettingsContainer ConstructL(%d) return",aResourceId );
+
+    //CheckFileExistenceL();
+    // If CheckFileExistenceL is called directly from
+    // ConstructL, DoActivateL in ProfileApp::CProfileSettingsView will be
+    // blocked while the notes are displayed, causing problems.
+	// This timer will trigger only once (after 100 ms). After
+	// that it will be destroyed.
+	iPeriodic = CPeriodic::NewL( CActive::EPriorityStandard );
+	iPeriodic->Start(KFileCheckDelay,
+					KFileCheckInterval,
+					TCallBack( CProfileSettingsContainer::StartFileCheckL, this )
+					);
+
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsContainer::NewL
+// Two-phased constructor. Note, this constructor is DEPRECATED and will return
+// only NULL if called.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CProfileSettingsContainer* CProfileSettingsContainer::NewL(
+    CAknView& /* aAknView */,
+    CProfileEngineHandler& /* aEngineHandler */,
+    CProfileIndexHandler* /* aIndexHandler */,
+    CProfileTabHandler* /* aTabHandler */,
+    CAknTitlePane* /* aTitlePane */ )
+    {
+    return NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsContainer::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CProfileSettingsContainer* CProfileSettingsContainer::NewL(
+    MProfileViewHandler& aProfileViewHandler,
+    CProfileEngineHandler& aEngineHandler,
+    MProfileExternalSettingsHandler& aExternalSettingsHandler,
+    CProfileIndexHandler* aIndexHandler,
+    CProfileTabHandler* aTabHandler,
+    CAknTitlePane* aTitlePane )
+    {
+    return CProfileSettingsContainer::NewL( aProfileViewHandler, aEngineHandler,
+            aExternalSettingsHandler, aIndexHandler, aTabHandler, aTitlePane,
+            R_PROFILE_SETTING_ITEM_LIST );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsContainer::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CProfileSettingsContainer* CProfileSettingsContainer::NewL(
+    MProfileViewHandler& aProfileViewHandler,
+    CProfileEngineHandler& aEngineHandler,
+    MProfileExternalSettingsHandler& aExternalSettingsHandler,
+    CProfileIndexHandler* aIndexHandler,
+    CProfileTabHandler* aTabHandler,
+    CAknTitlePane* aTitlePane,
+    TInt aResourceId )
+    {
+    CProfileSettingsContainer* self = new( ELeave ) CProfileSettingsContainer(
+        aProfileViewHandler, aEngineHandler, aExternalSettingsHandler,
+        aIndexHandler, aTabHandler, aTitlePane );
+    CleanupStack::PushL( self );
+    self->ConstructL( aProfileViewHandler.View().ClientRect(), aResourceId );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// Destructor.
+CProfileSettingsContainer::~CProfileSettingsContainer()
+    {
+	if( iPeriodic )
+		{
+		iPeriodic->Cancel();
+		delete iPeriodic;
+		}
+
+    if( iFs )
+    	{
+    	iFs->Close();
+    	}
+    delete iFs;
+
+    PRODEBUG( "~CProfileSettingsContainer begin" );
+    delete iNotifier;
+    PRODEBUG( "~CProfileSettingsContainer 2" );
+    if( iTabHandler )
+        {
+        iTabHandler->SetTabObserver( NULL );
+        }
+    PRODEBUG( "~CProfileSettingsContainer 3" );
+    if( iIndexHandler )
+        {
+        iIndexHandler->SetListBox( NULL );
+        }
+    PRODEBUG( "~CProfileSettingsContainer 4" );
+    iResourceLoader.Close();
+    PRODEBUG( "~CProfileSettingsContainer 5" );
+    ReleaseProfile();
+    PRODEBUG( "~CProfileSettingsContainer 6" );
+    delete iCopyProfile;
+    PRODEBUG( "~CProfileSettingsContainer 7" );
+
+    if ( iVoIPVariationNotifier )
+        {
+        iVoIPVariationNotifier->StopListening();
+        delete iVoIPVariationNotifier;
+        }
+    if ( iVoIPVariation )
+        {
+    	delete iVoIPVariation;
+    	}
+    	  
+    delete iTTSSession;
+    delete iSession;
+    
+    delete iDefaultTone;
+    PRODEBUG( "~CProfileSettingsContainer 8" );
+    
+   	iSSSettings.Close();
+    PRODEBUG( "~CProfileSettingsContainer end" );
+    delete iNaviPaneContainer;
+    }
+
+// ------------------------------------------------------------------------------
+// CProfileSettingsContainer::StartFileCheckL
+// ------------------------------------------------------------------------------
+//
+TInt CProfileSettingsContainer::StartFileCheckL( TAny* aObj )
+	{
+	static_cast<CProfileSettingsContainer*>(aObj)->DoFileCheckL();
+	return 1;
+	}
+
+// ------------------------------------------------------------------------------
+// CProfileSettingsContainer::DoFileCheckL
+// ------------------------------------------------------------------------------
+//
+void CProfileSettingsContainer::DoFileCheckL()
+	{
+	if( iPeriodic )
+		{
+		iPeriodic->Cancel();
+		delete iPeriodic;
+		iPeriodic = NULL;
+		}
+
+	CheckFileExistenceL();
+	}
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsContainer::AllowedToChange
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CProfileSettingsContainer::AllowedToChange(
+    TInt aSettingItemId ) const
+    {
+    TUint32 flags( iProfile->ModifiableFlags() );
+    switch( aSettingItemId )
+        {
+        // Fall through: If ringing tone is not allowed to change, then none of
+        // these setting items are allowed to change.
+        case EProfileSettingRingingToneId:
+        case EProfileSettingRingingToneLine1Id:
+        case EProfileSettingRingingToneLine2Id:
+            {
+            TInt profileId( 0 );
+            // Get id of the edited profile
+            profileId=iProfile->ProfileName().Id();
+            if( profileId == EProfileOffLineId )
+                {
+                // VOIP Changes: WLAN can be enabled also in off-line profile
+                TBool featuresSupported(
+                        FeatureManager::FeatureSupported(KFeatureIdCommonVoip)
+                        &&
+                        FeatureManager::FeatureSupported(KFeatureIdProtocolWlan)
+                        );
+                return ( ( flags & EProfileFlagRingingTone ) &&
+                         featuresSupported && iVoIPStatus );
+                }
+            else
+                {
+                return flags & EProfileFlagRingingTone;
+                }
+            }
+
+
+        case EProfileSettingVideoCallToneId:
+            {
+            return flags & EProfileFlagVideoCallRingingTone;
+            }
+	    case EProfileSettingRingingTypeId:
+            {
+            return flags & EProfileFlagRingingType;
+            }
+        case EProfileSettingRingingVolumeId:
+            {
+            return flags & EProfileFlagRingingVolume;
+            }
+		 case EProfileSettingMediaVolumeId:
+            {
+            return flags & EProfileFlagMediaVolume;
+            }
+        case EProfileSettingMessageAlertToneId:
+            {
+            return flags & EProfileFlagMessageAlertTone;
+            }
+        case EProfileSettingEmailAlertToneId:
+            {
+            return flags & EProfileFlagEmailAlertTone;
+            }
+        case EProfileSettingVibratingAlertId:
+            {
+            return flags & EProfileFlagVibratingAlert;
+            }
+        case EProfileSettingEmailVibratingAlertId:
+            {
+            return flags & EProfileFlagVibratingAlert;
+            }           
+        case EProfileSettingKeypadVolumeId:
+            {
+            return flags & EProfileFlagKeypadVolume;
+            }
+        case EProfileSettingWarningAndGameTonesId:
+            {
+            return flags & EProfileFlagWarningTones;
+            }
+		case EProfileSettingTTSRingingToneId:
+			{
+			return flags & EProfileFlagTextToSpeechTone;
+			}
+        case EProfileSettingAlertForId:
+            {
+            return flags & EProfileFlagAlertFor;
+            }
+        case EProfileSettingProfileNameId:
+            {
+            return flags & EProfileFlagProfileName;
+            }
+        case EProfileSettingPTTRingingToneId:
+            {
+            return flags & EProfileFlagPttTone;
+            }
+        case EProfileSettingPTTStatusId:
+            {
+            return flags & EProfileFlagPttStatus;
+            }
+        case EProfileSettingTactileFeedbackId:
+            {
+            return flags & EProfileFlagTactileFeedback;
+            }
+    	case EProfileSettingAudioFeedbackId:
+            {
+            return flags & EProfileFlagAudioFeedback;
+            }            
+        case EProfileSetting3dEffectId:
+            {
+            return flags & EProfileFlag3DEffect;
+            }
+ 		case EProfileSetting3dEchoId:
+            {
+            return flags & EProfileFlag3DEcho;
+            }            
+             
+        default:
+            {
+            return iExternalSettingsHandler.AllowedToChange( aSettingItemId );
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsContainer::ReleaseProfile
+// -----------------------------------------------------------------------------
+//
+void CProfileSettingsContainer::ReleaseProfile()
+    {
+    if( iProfile )
+        {
+        iProfile->Release();
+        iProfile = NULL;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsContainer::ReadProfileL
+// -----------------------------------------------------------------------------
+//
+void CProfileSettingsContainer::ReadProfileL()
+    {
+    TInt profileId( KErrNotFound );
+    if( iIndexHandler )
+        {
+        // Index handler is set, get id of the edited profile
+        profileId = iEngineHandler.IdForIndex(
+            iIndexHandler->CurrentProfileIndex() );
+        }
+    else
+        {
+        // Index handler is not set.
+        profileId = User::LeaveIfError(
+            iEngineHandler.Engine()->ActiveProfileId() );
+        }
+    MProfileExtended* profile = iEngineHandler.Engine()->ProfileLC( profileId );
+    iCopyProfile->LoadL( profile );
+    CleanupStack::Pop(); // profile
+    ReleaseProfile(); // delete old iProfile
+    iProfile = profile;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsContainer::SetHiddenFlagsL
+// -----------------------------------------------------------------------------
+//
+void CProfileSettingsContainer::SetHiddenFlagsL()
+    {
+    CAknSettingItemArray* array = SettingItemArray();
+    TUint32 flags( iProfile->VisibleFlags() );
+    TInt profileId( 0 );
+	const MProfileTones& tones = iProfile->ProfileTones();
+	const TProfileToneSettings& toneSettings = tones.ToneSettings();
+	
+    TBool hide3DEcho = EFalse;
+    TInt effect = iProfile->ProfileExtraSettings().Profile3DToneSettings().Effect();
+    if ( effect == EProfile3DEffectOff || effect == EProfile3DEffectStereoWidening )
+        {
+        hide3DEcho = ETrue;
+        }
+
+    // Get id of the edited profile
+    profileId=iProfile->ProfileName().Id();
+
+    if( profileId == EProfileOffLineId )
+        {
+        TBool featuresSupported(
+                FeatureManager::FeatureSupported( KFeatureIdCommonVoip ) &&
+                FeatureManager::FeatureSupported( KFeatureIdProtocolWlan) );
+        SetItemHidden( EProfileSettingRingingToneId, array,
+            ( iAlternateLineService ) || ( ( ~flags & EProfileFlagRingingTone )
+            || !featuresSupported || !iVoIPStatus ) );
+        SetItemHidden( EProfileSettingRingingToneLine1Id, array,
+            ( !iAlternateLineService ) || ( ( ~flags & EProfileFlagRingingTone )
+            || !featuresSupported || !iVoIPStatus ) );
+        SetItemHidden( EProfileSettingRingingToneLine2Id, array,
+            ( !iAlternateLineService ) || ( ( ~flags & EProfileFlagRingingTone )
+            || !featuresSupported || !iVoIPStatus ) );
+	  	SetItemHidden( EProfileSetting3dEffectId, array,
+	  		!( ( FeatureManager::FeatureSupported( KFeatureId3DRingingTones ) ) &&
+	        ( flags & EProfileFlag3DEffect ) && featuresSupported ) );
+		SetItemHidden( EProfileSetting3dEchoId, array,
+	  		!( ( FeatureManager::FeatureSupported( KFeatureId3DRingingTones ) ) &&
+	        ( flags & EProfileFlag3DEcho ) && featuresSupported ) );
+        }
+    else
+        {
+        SetItemHidden( EProfileSettingRingingToneId, array,
+            ( iAlternateLineService ) || ( ~flags & EProfileFlagRingingTone ) );
+        SetItemHidden( EProfileSettingRingingToneLine1Id, array,
+            ( !iAlternateLineService ) || ( ~flags & EProfileFlagRingingTone ) );
+        SetItemHidden( EProfileSettingRingingToneLine2Id, array,
+            ( !iAlternateLineService ) || ( ~flags & EProfileFlagRingingTone ) );
+	  	SetItemHidden( EProfileSetting3dEffectId, array,
+	  		!( ( FeatureManager::FeatureSupported( KFeatureId3DRingingTones ) ) &&
+	        ( flags & EProfileFlag3DEffect ) ) );
+		SetItemHidden( EProfileSetting3dEchoId, array,
+	  		!( ( FeatureManager::FeatureSupported( KFeatureId3DRingingTones ) ) &&
+	        ( flags & EProfileFlag3DEcho ) ) );
+        }
+
+    if ( hide3DEcho )
+        {
+      	SetItemHidden( EProfileSetting3dEchoId, array, ETrue );
+        }
+
+    SetItemHidden( EProfileSettingVideoCallToneId, array,
+        !( ( iLocalFeatures->IsFeatureSupported(
+        KProEngFeatureIdVTRingingTone ) ) &&
+        ( flags & EProfileFlagVideoCallRingingTone ) &&
+        FeatureManager::FeatureSupported( KFeatureIdCsVideoTelephony ) ) );
+
+	SetItemHidden( EProfileSettingMessageAlertToneId, array,
+        ~flags & EProfileFlagMessageAlertTone );
+        
+    SetItemHidden( EProfileSettingEmailAlertToneId, array,
+        !( ( FeatureManager::FeatureSupported( KFeatureIdAlwaysOnLineEmail ) ) &&
+        ( flags & EProfileFlagEmailAlertTone ) ) );
+            
+	SetItemHidden( EProfileSettingRingingTypeId, array,
+        ~flags & EProfileFlagRingingType );
+        
+    SetItemHidden( EProfileSettingRingingVolumeId, array,
+        ~flags & EProfileFlagRingingVolume );
+        
+    SetItemHidden( EProfileSettingMediaVolumeId, array,
+		!( ( FeatureManager::FeatureSupported( KFeatureIdProtocolCdma ) ) &&
+		( flags & EProfileFlagMediaVolume ) ) );
+		
+	SetItemHidden( EProfileSettingVibratingAlertId, array,
+        ~flags & EProfileFlagVibratingAlert );
+
+	if(!iCopyProfile->iVibratingAlert)
+	   {
+	   SetItemHidden( EProfileSettingEmailVibratingAlertId, array,ETrue );	
+	   }
+	else
+	   {
+	   SetItemHidden( EProfileSettingEmailVibratingAlertId, array,EFalse );
+	   }         
+
+	SetItemHidden( EProfileSettingKeypadVolumeId, array,
+        ~flags & EProfileFlagKeypadVolume );
+        
+    SetItemHidden( EProfileSettingWarningAndGameTonesId, array,
+        ~flags & EProfileFlagWarningTones );
+
+	// Check if TTS ringingtone is supported
+	TBool textToSpeech( EFalse );
+   	User::LeaveIfError( iTTSSession->Get( KProfilesLVFlags, textToSpeech ) );
+   	textToSpeech &= KProEngFeatureIdTTSRingingTone;
+
+	SetItemHidden( EProfileSettingTTSRingingToneId, array,
+		!( textToSpeech && ( flags & EProfileFlagTextToSpeechTone ) ) );
+
+    SetItemHidden( EProfileSettingAlertForId, array,
+        ~flags & EProfileFlagAlertFor );
+
+    SetItemHidden( EProfileSettingProfileNameId, array,
+        ~flags & EProfileFlagProfileName );
+
+	SetItemHidden( EProfileSettingPTTRingingToneId, array,
+		!( ( FeatureManager::FeatureSupported( KFeatureIdOmaPoc ) ) &&
+		( flags & EProfileFlagPttTone ) ) );
+
+	SetItemHidden( EProfileSettingPTTStatusId, array,
+		!( ( FeatureManager::FeatureSupported( KFeatureIdOmaPoc ) ) &&
+		( flags & EProfileFlagPttStatus ) ) );
+		
+  	SetItemHidden( EProfileSettingTactileFeedbackId, array,
+  		!( ( FeatureManager::FeatureSupported( KFeatureIdTactileFeedback ) ) &&
+        ( flags & EProfileFlagTactileFeedback ) ) );
+	SetItemHidden( EProfileSettingAudioFeedbackId, array,
+		!( ( FeatureManager::FeatureSupported( KFeatureIdTactileFeedback ) ) &&
+        ( flags & EProfileFlagAudioFeedback ) ) );
+
+
+	// Check if SilentMode is supported
+	TBool silentMode(
+	 iLocalFeatures->IsFeatureSupported( KProEngFeatureIdForceSilentMode ) );	
+	
+	if( ( silentMode ) && ( profileId == EProfileSilentId ) )
+		{
+		SetItemHidden( EProfileSettingRingingToneId, array, ETrue );
+		SetItemHidden( EProfileSettingRingingToneLine1Id, array, ETrue );
+		SetItemHidden( EProfileSettingRingingToneLine2Id, array, ETrue );
+		SetItemHidden( EProfileSettingVideoCallToneId, array, ETrue );
+		SetItemHidden( EProfileSettingTTSRingingToneId, array, ETrue );
+		SetItemHidden( EProfileSettingRingingTypeId, array, ETrue );
+		SetItemHidden( EProfileSettingRingingVolumeId, array, ETrue );
+		SetItemHidden( EProfileSettingMessageAlertToneId, array, ETrue );
+		SetItemHidden( EProfileSettingEmailAlertToneId, array, ETrue );
+		SetItemHidden( EProfileSettingKeypadVolumeId, array, ETrue );
+		SetItemHidden( EProfileSettingWarningAndGameTonesId, array, ETrue );
+		SetItemHidden( EProfileSettingPTTRingingToneId, array, ETrue );
+		SetItemHidden( EProfileSettingProfileNameId, array, ETrue );
+		SetItemHidden( EProfileSettingAudioFeedbackId, array, ETrue );
+		SetItemHidden( EProfileSetting3dEffectId, array, ETrue );
+		SetItemHidden( EProfileSetting3dEchoId, array, ETrue );
+		}
+
+    iExternalSettingsHandler.SetHiddenItems( *array );
+
+    if( iIndexHandler )
+    	{
+	    iIndexHandler->LoadIndices();
+    	}
+
+    HandleChangeInItemArrayOrVisibilityL();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsContainer::UpdateSettingsL
+// -----------------------------------------------------------------------------
+//
+void CProfileSettingsContainer::UpdateSettingsL( TBool aReadProfileSettings )
+    {
+	// Set listbox invicible to avoid flicker
+    CEikListBox* listBox = ListBox();
+    listBox->MakeVisible( EFalse );
+
+    // Leavable function calls must be trapped in order to set listbox
+    // back to visible again if a leave occurs
+    TRAPD( error,
+        if( aReadProfileSettings )
+            {
+            ReadProfileL();
+            }
+        LoadSettingsL(); // from CAknSettingItemList
+        SetHiddenFlagsL();
+        );
+
+    if( aReadProfileSettings && iIndexHandler )
+        {
+        // Set focus back on correct index
+        iIndexHandler->LoadIndices();
+        }
+
+    // Set listbox back to visible
+    listBox->MakeVisible( ETrue );
+
+    // Now proceed with the leave if one occured
+    User::LeaveIfError( error );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsContainer::EditItemL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CProfileSettingsContainer::EditItemL( TInt aIndex, TBool aCalledFromMenu )
+    {
+    PRODEBUG1( "CProfileSettingsContainer EditItemL(%d) begin",aIndex );
+
+    // Prevent opening of several setting items
+    if( iItemEdited )
+    	{
+    	return;
+    	}
+
+    CAknSettingItem* item = SettingItemArray()->At( aIndex );
+    TInt identifier( item->Identifier() );
+
+    if ( PowerSaveMode( identifier ) )
+        {
+        HBufC* buf = StringLoader::LoadLC( R_PROFILE_TEXT_PSM_INFONOTE );
+        CAknInformationNote* queryDialog = new (ELeave) CAknInformationNote( ETrue );
+     	queryDialog->ExecuteLD( *buf );
+        CleanupStack::PopAndDestroy( buf );
+        return;
+        }
+    
+    if( !AllowedToChange( identifier ) )
+        {
+        // If a setting is not allowed to change, "swallow" list box event.
+        return;
+        }
+
+    HBufC* titleText = NULL;
+
+    if( ( identifier != EProfileSettingRingingToneId ) &&
+        ( identifier != EProfileSettingRingingToneLine1Id ) &&
+        ( identifier != EProfileSettingRingingToneLine2Id ) &&
+        ( identifier != EProfileSettingVideoCallToneId ) &&
+        ( identifier != EProfileSettingMessageAlertToneId ) &&
+        ( identifier != EProfileSettingEmailAlertToneId ) &&
+        ( identifier != EProfileSettingPTTRingingToneId ) )
+        {
+        if( aCalledFromMenu ||
+            !( identifier == EProfileSettingVibratingAlertId ||
+               identifier == EProfileSettingEmailVibratingAlertId ||
+               identifier == EProfileSettingWarningAndGameTonesId ||
+               identifier == EProfileSettingTTSRingingToneId ) )
+            {
+            // Set profile name as title pane text.
+            // Tone selections launch a pop-up, so title pane is not changed.
+            // Binary pop-up setting item with two available values does not
+            // launch a setting page when not called from menu so title pane
+            // is not changed.
+            if( iTitlePane )
+                {
+                titleText = iTitlePane->Text()->AllocLC();
+                SetTitlePaneTextL( iCopyProfile->iTitleName );
+                }
+            }
+        }
+
+    
+    TInt threeDEffect = iCopyProfile->i3DEffect;
+    if( identifier == EProfileSetting3dEffectId && iIndexHandler )
+    	{
+    	iIndexHandler->StoreIndices();
+    	}
+    
+    TInt vibratingAlert = iCopyProfile->iVibratingAlert;
+    if( identifier == EProfileSettingVibratingAlertId && iIndexHandler )
+      	{
+      	iIndexHandler->StoreIndices();
+      	}
+    
+    // Set boolean value to ETrue that we know that the settings container
+    // is in editing mode.
+    iItemEdited = ETrue;
+    // Store currently active profile id
+    TInt activeProfileId( iEngineHandler.Engine()->ActiveProfileId() );
+
+    // Trap to set boolean value back to EFalse after EditItemL finalized.
+    PRODEBUG1( "CProfileSettingsContainer EditItemL before list::EditItemL(%d)",aIndex );
+    TRAPD( error, CAknSettingItemList::EditItemL( aIndex, aCalledFromMenu ) );
+    PRODEBUG1( "CProfileSettingsContainer EditItemL after list::EditItemL(),error=%d",error );
+    iItemEdited = EFalse;
+    User::LeaveIfError( error );
+
+    // We don't know whether user cancelled or oked the setting so we must
+    // store the data from setting item to the modified profile (iCopyProfile).
+    item->StoreL();
+    // Compare the settings of the modified profile
+    // to the settings currently in Profile Engine.
+    if( !iCopyProfile->CompareL( iProfile ) )
+        {
+        // Handle removing of DRM automated content
+        iCopyProfile->RemoveAutomatedContentL( iProfile );
+        // Something has changed. Store settings of modified profile.
+        iCopyProfile->StoreL( iProfile );
+        // Trap saving of the profile. If for example flash memory runs out
+        // we can still revert the UI to its previous state.
+        TRAP( error, iEngineHandler.Engine()->CommitChangeL( *iProfile ) );
+        if( error != KErrNone || PowerSaveMode() )
+            {
+            // An User::Leave occurred. Try to read old settings to memory.
+            ReadProfileL();
+            // Update setting item so UI is left to correct state.
+            item->LoadL();
+            item->UpdateListBoxTextL();
+            }
+  		else if( identifier ==  EProfileSettingProfileNameId )
+            {
+            // Profile name was changed.
+            UpdateProfileNamesL();
+            }
+            
+        if ( threeDEffect != iCopyProfile->i3DEffect )
+            {
+            UpdateSettingsL( EFalse );  // hide 3DEcho if 3DEffect is off
+            }
+        
+        if ( vibratingAlert != iCopyProfile->iVibratingAlert )
+          	{
+          	UpdateSettingsL( EFalse ); //hide emailVibrating alert if vibrating alert is off
+           	}
+        }
+    // If the setting is an external (= only in Tones View):
+    iExternalSettingsHandler.StoreIfChangedL( identifier );
+
+    if( titleText )
+        {
+        // Set title pane text back
+        SetTitlePaneTextL( *titleText );
+        CleanupStack::PopAndDestroy( titleText );
+        }
+    // Compare active profile to previously active profile
+    TInt newActiveProfileId( iEngineHandler.Engine()->ActiveProfileId() );
+    if( activeProfileId != newActiveProfileId )
+        {
+        // Active profile has changed while editing. Update UI.
+        HandleActiveProfileEventL( EProfileNewActiveProfile, newActiveProfileId );
+        }
+    User::LeaveIfError( error );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsContainer::CreateSettingItemL
+// -----------------------------------------------------------------------------
+//
+CAknSettingItem* CProfileSettingsContainer::CreateSettingItemL(
+    TInt aIdentifier )
+    {
+    PRODEBUG1( "CProfileSettingsContainer CreateSettingsItemL(%d)",aIdentifier );
+    CAknSettingItem* settingItem = NULL;
+
+    switch( aIdentifier )
+        {
+        // Flow through: Ringing tone and RT line 1 are stored to the same
+        // variable because they can not exist at the same time.
+        case EProfileSettingRingingToneId:
+        case EProfileSettingRingingToneLine1Id:
+            {
+            settingItem = CreateFileListSettingItemL(
+                *iCopyProfile->iRingingTone, aIdentifier );
+            break;
+            }
+        case EProfileSettingRingingToneLine2Id:
+            {
+            settingItem = CreateFileListSettingItemL(
+                *iCopyProfile->iRingingToneLine2, aIdentifier );
+            break;
+            }
+        case EProfileSettingVideoCallToneId:
+            {
+            settingItem = CreateFileListSettingItemL(
+                *iCopyProfile->iVideoCallTone, aIdentifier );
+            break;
+            }
+        case EProfileSettingMessageAlertToneId:
+            {
+            settingItem = CreateFileListSettingItemL(
+                *iCopyProfile->iMessageAlertTone, aIdentifier );
+            break;
+            }
+        case EProfileSettingEmailAlertToneId:
+            {
+            settingItem = CreateFileListSettingItemL(
+                *iCopyProfile->iEmailAlertTone, aIdentifier );
+            break;
+            }
+        case EProfileSettingRingingTypeId:
+            {
+            settingItem = new( ELeave ) CAknEnumeratedTextPopupSettingItem(
+                aIdentifier, iCopyProfile->iRingingType );
+            break;
+            }
+        case EProfileSettingRingingVolumeId:
+            {
+            settingItem = new( ELeave ) CProfilePlayingVolumeSettingItem(
+                aIdentifier, iCopyProfile->iRingingVolume,
+                *iCopyProfile->iRingingTone,
+                iCopyProfile->iRingingType,
+                iCopyProfile->iVibratingAlert,
+                EFalse ); //Display confirmation note for maximum volume
+            break;
+            }
+		 case EProfileSettingMediaVolumeId:
+            {
+            settingItem = new( ELeave ) CProfilePlayingVolumeSettingItem(
+                aIdentifier, iCopyProfile->iMediaVolume,
+                *iCopyProfile->iRingingTone,
+                iCopyProfile->iRingingType,
+                iCopyProfile->iVibratingAlert,
+                EFalse ); //Do not display confirmation note for maximum volume
+            break;
+            }
+        case EProfileSettingVibratingAlertId:
+            {
+            settingItem = new( ELeave ) CAknBinaryPopupSettingItem(
+                aIdentifier, iCopyProfile->iVibratingAlert );
+            break;
+            }
+        case EProfileSettingEmailVibratingAlertId:
+            {
+            settingItem = new( ELeave ) CAknBinaryPopupSettingItem(
+                aIdentifier, iCopyProfile->iEmailVibratingAlert );
+            break;
+            }
+        case EProfileSettingKeypadVolumeId:
+            {
+            settingItem = new( ELeave ) CProfileKeypadVolumeSettingItem(
+                aIdentifier, iCopyProfile->iKeypadVolume, iKeySounds );
+            break;
+            }
+        case EProfileSettingWarningAndGameTonesId:
+            {
+            settingItem = new( ELeave ) CAknBinaryPopupSettingItem(
+                aIdentifier, iCopyProfile->iWarningAndGameTones );
+            break;
+            }
+        case EProfileSettingAlertForId:
+            {
+            settingItem = new( ELeave ) CProfileAlertForSettingItem(
+                aIdentifier, iCopyProfile->iContactList, iCoeEnv );
+            break;
+            }
+        case EProfileSettingProfileNameId:
+            {
+            settingItem = new( ELeave ) CProfileNameSettingItem(
+                aIdentifier, iCopyProfile->iProfileName, iEngineHandler );
+            break;
+            }
+		case EProfileSettingTTSRingingToneId:
+			{
+			settingItem = new( ELeave ) CAknBinaryPopupSettingItem(
+                aIdentifier, iCopyProfile->iTextToSpeech );
+			break;
+			}
+		case EProfileSettingPTTRingingToneId:
+			{
+		 	settingItem = CreateFileListSettingItemL(
+                *iCopyProfile->iPTTRingingTone, aIdentifier );
+			break;
+			}
+		case EProfileSettingPTTStatusId:
+			{
+			settingItem = new( ELeave ) CAknEnumeratedTextPopupSettingItem(
+                aIdentifier, iCopyProfile->iPTTStatus );
+			break;
+			}
+		case EProfileSettingTactileFeedbackId:
+            {
+            /*
+            settingItem = new( ELeave ) CAknEnumeratedTextPopupSettingItem(
+                aIdentifier, iCopyProfile->iTactileFeedback );
+            */
+            settingItem = new( ELeave ) CProfileFeedbackSettingItem(
+                aIdentifier, iCopyProfile->iTactileFeedback );
+            break;
+            }    
+		case EProfileSettingAudioFeedbackId:
+            {
+            /*
+            settingItem = new( ELeave ) CAknEnumeratedTextPopupSettingItem(
+                aIdentifier, iCopyProfile->iAudioFeedback );
+            */
+            settingItem = new( ELeave ) CProfileFeedbackSettingItem(
+                aIdentifier, iCopyProfile->iAudioFeedback );
+            break;
+            }
+		case EProfileSetting3dEffectId:
+            {
+            /*
+            settingItem = new( ELeave ) CAknEnumeratedTextPopupSettingItem(
+                aIdentifier, iCopyProfile->i3DEffect );
+            */
+            settingItem = new( ELeave ) CProfile3dSettingItem(
+                aIdentifier,
+                iCopyProfile->i3DEffect,
+                *iCopyProfile->iRingingTone,
+                iCopyProfile->iRingingType,
+                iCopyProfile->iVibratingAlert,
+                iCopyProfile->iRingingVolume,
+                iCopyProfile->i3DEcho );
+            break;
+            }    
+		case EProfileSetting3dEchoId:
+            {
+            /*
+            settingItem = new( ELeave ) CAknEnumeratedTextPopupSettingItem(
+                aIdentifier, iCopyProfile->i3DEcho );
+            */
+            settingItem = new( ELeave ) CProfile3dSettingItem(
+                aIdentifier,
+                iCopyProfile->i3DEcho,
+                *iCopyProfile->iRingingTone,
+                iCopyProfile->iRingingType,
+                iCopyProfile->iVibratingAlert,
+                iCopyProfile->iRingingVolume,
+                iCopyProfile->i3DEffect );
+            break;
+            }
+			
+        default:
+            {
+            PRODEBUG1( "CProfileSettingsContainer before extShandler::CreateSI(%d)",aIdentifier );
+            settingItem = iExternalSettingsHandler.CreateSettingItemL( aIdentifier );
+            PRODEBUG( "CProfileSettingsContainer after extShandler::CreateSI" );
+            break;
+            }
+        }
+    PRODEBUG1( "CProfileSettingsContainer CreateSettingsItemL(%d) before return",aIdentifier );
+    return settingItem;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsContainer::CheckFileExistenceL
+// -----------------------------------------------------------------------------
+//  
+void CProfileSettingsContainer::CheckFileExistenceL()
+	{
+	 CAknSettingItemArray* array = SettingItemArray();
+	            
+	if( !IsItemHidden( EProfileSettingRingingToneId, array ) )
+		{
+		if( !BaflUtils::FileExists( *iFs, *iCopyProfile->iRingingTone ) )
+			{
+			TParsePtrC tone( *iCopyProfile->iRingingTone );
+        	HBufC* ringtoneNotFoundText =
+        		StringLoader::LoadLC(
+        		R_PROFILE_CONFIRM_RINGTONE_FOUND, tone.NameAndExt() );
+
+	    	CProfileSettingsContainer::LaunchDialogL( *ringtoneNotFoundText );
+        	CleanupStack::PopAndDestroy( ringtoneNotFoundText );
+			}
+		}
+		
+	if( !IsItemHidden( EProfileSettingRingingToneLine1Id, array ) )
+		{
+		if( !BaflUtils::FileExists( *iFs, *iCopyProfile->iRingingTone ) )
+			{
+			TParsePtrC tone( *iCopyProfile->iRingingTone );
+        	HBufC* ringtoneNotFoundText =
+        		StringLoader::LoadLC(
+        		R_PROFILE_CONFIRM_RINGTONE_FOUND, tone.NameAndExt() );
+
+	    	CProfileSettingsContainer::LaunchDialogL( *ringtoneNotFoundText );
+        	CleanupStack::PopAndDestroy( ringtoneNotFoundText );
+			}
+		}	
+	
+	if( !IsItemHidden( EProfileSettingRingingToneLine2Id, array ) )
+		{
+		if( !BaflUtils::FileExists( *iFs, *iCopyProfile->iRingingToneLine2 ) )
+			{
+			TParsePtrC tone( *iCopyProfile->iRingingToneLine2 );
+        	HBufC* ringtoneNotFoundText =
+        		StringLoader::LoadLC(
+        		R_PROFILE_CONFIRM_RINGTONE_FOUND, tone.NameAndExt() );
+
+			CProfileSettingsContainer::LaunchDialogL( *ringtoneNotFoundText );
+			CleanupStack::PopAndDestroy( ringtoneNotFoundText );
+			}
+		}
+	
+	if( !IsItemHidden( EProfileSettingVideoCallToneId, array ) )
+		{		
+		if( !BaflUtils::FileExists( *iFs, *iCopyProfile->iVideoCallTone ) )
+			{
+			TParsePtrC tone( *iCopyProfile->iVideoCallTone );
+    		HBufC* ringtoneNotFoundText =
+    			StringLoader::LoadLC(
+        		R_PROFILE_CONFIRM_RINGTONE_FOUND, tone.NameAndExt() );
+
+	    	CProfileSettingsContainer::LaunchDialogL( *ringtoneNotFoundText );
+        	CleanupStack::PopAndDestroy( ringtoneNotFoundText );
+			}
+		}
+	
+	if( !IsItemHidden( EProfileSettingMessageAlertToneId, array ) )
+		{	
+		if( !BaflUtils::FileExists( *iFs, *iCopyProfile->iMessageAlertTone ) )
+			{
+			TParsePtrC tone( *iCopyProfile->iMessageAlertTone );
+    		HBufC* ringtoneNotFoundText =
+    			StringLoader::LoadLC(
+        		R_PROFILE_CONFIRM_RINGTONE_FOUND, tone.NameAndExt() );
+
+	    	CProfileSettingsContainer::LaunchDialogL( *ringtoneNotFoundText );
+        	CleanupStack::PopAndDestroy( ringtoneNotFoundText );
+			}
+		}
+	
+	if( !IsItemHidden( EProfileSettingEmailAlertToneId, array ) )
+		{	
+		if( !BaflUtils::FileExists( *iFs, *iCopyProfile->iEmailAlertTone ) )
+			{
+			TParsePtrC tone( *iCopyProfile->iEmailAlertTone );
+    		HBufC* ringtoneNotFoundText =
+    			StringLoader::LoadLC(
+        		R_PROFILE_CONFIRM_RINGTONE_FOUND, tone.NameAndExt() );
+
+	    	CProfileSettingsContainer::LaunchDialogL( *ringtoneNotFoundText );
+        	CleanupStack::PopAndDestroy( ringtoneNotFoundText );
+			}
+		}
+	
+	if( !IsItemHidden( EProfileSettingPTTRingingToneId, array ) )
+		{	
+		if( !BaflUtils::FileExists( *iFs, *iCopyProfile->iPTTRingingTone ) )
+			{
+			TParsePtrC tone( *iCopyProfile->iPTTRingingTone );
+    		HBufC* ringtoneNotFoundText =
+    			StringLoader::LoadLC(
+        		R_PROFILE_CONFIRM_RINGTONE_FOUND, tone.NameAndExt() );
+
+	    	CProfileSettingsContainer::LaunchDialogL( *ringtoneNotFoundText );
+        	CleanupStack::PopAndDestroy( ringtoneNotFoundText );
+			}
+		}
+	}
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsContainer::LaunchDialogL
+// -----------------------------------------------------------------------------
+//
+void CProfileSettingsContainer::LaunchDialogL( const TDesC& aTitleText )
+	{
+	CAknQueryDialog* query = CAknQueryDialog::NewL();
+    	const TInt ret( query->ExecuteLD(
+    	 R_PROFILE_CONFIRM_RINGTONE_FOUND_QUERY, aTitleText) );
+	}
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsContainer::CreateFileListSettingItemL
+// -----------------------------------------------------------------------------
+//
+CAknSettingItem* CProfileSettingsContainer::CreateFileListSettingItemL(
+    TDes& aFileName, TInt aIdentifier )
+    {
+    CAknSettingItem* settingItem = new( ELeave ) CProfileFileListSettingItem(
+        aIdentifier,
+        aFileName,
+        iCopyProfile->iRingingType,
+        iCopyProfile->iRingingVolume,
+        iCopyProfile->iVibratingAlert,
+        iCopyProfile->i3DEffect,
+        iCopyProfile->i3DEcho,
+        iCoeEnv );
+
+    return settingItem;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsContainer::IndexForId
+// -----------------------------------------------------------------------------
+//
+TInt CProfileSettingsContainer::IndexForId( TInt aId ) const
+    {
+    CAknSettingItemArray* array = SettingItemArray();
+    TInt count( array->Count() );
+    for( TInt index( 0 ); index < count; index++ )
+        {
+        if( array->At( index )->Identifier() == aId )
+            {
+            // Searched ID was found, return index
+            return index;
+            }
+        }
+    return KErrNotFound;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsContainer::SetItemHidden
+// Sets an item hidden if an index for the id is found.
+// In other words does nothing if feature is not supported.
+// -----------------------------------------------------------------------------
+//
+void CProfileSettingsContainer::SetItemHidden( TInt aId,
+    CAknSettingItemArray* aArray, TBool aHidden )
+    {
+    TInt index( IndexForId( aId ) );
+    if( index == KErrNotFound )
+        {
+        return;
+        }
+    aArray->At( index )->SetHidden( aHidden );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsContainer::IsItemHidden
+// 
+// -----------------------------------------------------------------------------
+//
+TBool CProfileSettingsContainer::IsItemHidden( TInt aId,
+    CAknSettingItemArray* aArray ) const
+    {
+    TInt index( IndexForId( aId ) );
+    if( index == KErrNotFound )
+        {
+        return ETrue;
+        }
+        
+    return aArray->At( index )->IsHidden();
+    }    
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsContainer::SetTitlePaneTextL
+// -----------------------------------------------------------------------------
+//
+void CProfileSettingsContainer::SetTitlePaneTextL( const TDesC& aTitle )
+	{
+    if( !iTitlePane )
+        {
+        return;
+        }
+
+    if( aTitle.Length() > 0 )
+		{
+		iTitlePane->SetTextL( aTitle );
+		}
+	else
+		{
+		iTitlePane->SetTextToDefaultL(); // Application name
+		}
+	}
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsContainer::UpdateProfileNamesL
+// -----------------------------------------------------------------------------
+//
+void CProfileSettingsContainer::UpdateProfileNamesL()
+    {
+    if( iIndexHandler )
+        {
+        TInt newProfileIndex( iIndexHandler->ReadIdArrayAndUpdateL() );
+        if( iTabHandler )
+            {
+            // Refresh tabs with changed profile names
+            iTabHandler->RefreshTabsL();
+            iTabHandler->SetActiveTab( newProfileIndex );
+            }
+        else
+            {
+            // If the iTabHandler is NULL and the iNaviPaneContainer is not NULL
+            // Set the text of navi pane to currently personlize profile's name.
+            if ( iNaviPaneContainer )
+                {
+                MProfilesNamesArray* nameArray = iEngineHandler.IdArray();
+                iNaviPaneContainer->SetNaviPaneTextL( 
+                        nameArray->MdcaPoint( newProfileIndex ) );
+                }
+            }
+        }
+    else
+        {
+        // No index handler. Just refresh profile name array.
+        iEngineHandler.ReadIdArrayL();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsContainer::SizeChanged
+// -----------------------------------------------------------------------------
+//
+void CProfileSettingsContainer::SizeChanged()
+    {
+    CEikListBox* lb = ListBox();
+    if( lb )
+        {
+        lb->SetRect( Rect() );  // Set container's rect to listbox
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsContainer::HandleListBoxEventL
+// -----------------------------------------------------------------------------
+//
+void CProfileSettingsContainer::HandleListBoxEventL(
+    CEikListBox* aListBox, TListBoxEvent aEventType )
+    {
+    if( aEventType == EEventEnterKeyPressed ||
+        aEventType == EEventItemDoubleClicked )
+        {
+        CAknSettingItemArray* array = SettingItemArray();
+        if( !AllowedToChange( array->At( array->ItemIndexFromVisibleIndex(
+              ListBox()->CurrentItemIndex() ) )->Identifier() ) )
+            {
+            // If a setting is not allowed to change, "swallow" list box event.
+            return;
+            }
+        }
+    CAknSettingItemList::HandleListBoxEventL( aListBox, aEventType );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsContainer::GetHelpContext
+// -----------------------------------------------------------------------------
+//
+void CProfileSettingsContainer::GetHelpContext( TCoeHelpContext& aContext ) const
+    {
+    aContext.iMajor = KUidProfileApp;
+    if( !iExternalSettingsHandler.GetHelpContext( aContext ) )
+        {
+        aContext.iContext = KMODE_HLP_PERSONALISE;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsContainer::PhoneSettingChanged
+// -----------------------------------------------------------------------------
+//
+void CProfileSettingsContainer::PhoneSettingChanged(
+    TSSSettingsSetting aSetting, TInt aNewValue )
+    {
+    if( aSetting == ESSSettingsAls )
+        {
+        iAlternateLineService = ( aNewValue != ESSSettingsAlsNotSupported );
+        if( iIndexHandler )
+            {
+            iIndexHandler->StoreIndices();
+            }
+        // error ignored. If not enough memory to refresh the UI,
+        // don't bother launching an error note.
+        TRAP_IGNORE( SetHiddenFlagsL() );
+        if( iIndexHandler )
+            {
+            iIndexHandler->LoadIndices();
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsContainer::TabChangedL
+// When a tab changes, this method gets called.
+// -----------------------------------------------------------------------------
+//
+void CProfileSettingsContainer::TabChangedL( TInt /* aIndex */ )
+    {
+    UpdateSettingsL();
+
+    CEikListBox* listBox = ListBox();
+    if( listBox )
+    	{
+    	listBox->UpdateScrollBarsL();
+    	}
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsContainer::HandleActiveProfileEventL
+// When active profile changes, this method gets called.
+// -----------------------------------------------------------------------------
+//
+void CProfileSettingsContainer::HandleActiveProfileEventL(
+    TProfileEvent /* aProfileEvent */, TInt /* aProfileId */ )
+    {
+    /*
+    if( iItemEdited )
+        {
+        // Do not update UI if an item is being edited.
+        return;
+        }
+    */
+    UpdateProfileNamesL();
+    UpdateSettingsL();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsContainer::HandleExternalSettingsChangedL
+// When external settings change, this method gets called.
+// -----------------------------------------------------------------------------
+//
+void CProfileSettingsContainer::HandleExternalSettingsChangedL()
+    {
+    UpdateSettingsL( EFalse );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsContainer::HandleResourceChange
+// -----------------------------------------------------------------------------
+//
+void CProfileSettingsContainer::HandleResourceChange( TInt aType )
+    {
+    if ( aType == KEikDynamicLayoutVariantSwitch ||
+         aType == KAknsMessageSkinChange )
+        {
+        iProfileViewHandler.UpdateClientRect();
+        }
+    CAknSettingItemList::HandleResourceChange( aType );
+    }
+
+// ----------------------------------------------------
+//  CProfileSettingsContainer::HandleNotifyInt
+// ----------------------------------------------------
+//
+void CProfileSettingsContainer::HandleNotifyInt(
+    const TUint32 aID,
+    const TInt aNewValue )
+    {
+    if ( KDynamicVoIP == aID)
+        {
+        iVoIPStatus = KVoIPOFF != aNewValue;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsContainer::ItemEdited
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool CProfileSettingsContainer::ItemEdited() const
+    {
+    return iItemEdited;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsContainer::PowerSaveMode
+//
+// -----------------------------------------------------------------------------
+//
+TBool CProfileSettingsContainer::PowerSaveMode( TInt aSettingId )
+    {
+    TInt ret = EFalse;
+    
+    if ( aSettingId == EProfileSettingVibratingAlertId ||
+         aSettingId == EProfileSettingKeypadVolumeId ||
+         aSettingId == EProfileSettingTactileFeedbackId ||
+         aSettingId == EProfileSettingAudioFeedbackId ||aSettingId == EProfileSettingEmailVibratingAlertId)
+        {
+      	ret = PowerSaveMode();
+        }
+
+    return ret;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsContainer::PowerSaveModeL
+//
+// -----------------------------------------------------------------------------
+//
+TBool CProfileSettingsContainer::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;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsContainer::PowerSaveMode
+//
+// -----------------------------------------------------------------------------
+//
+TBool CProfileSettingsContainer::PowerSaveMode()
+    {
+    TBool psm = EFalse;
+    
+    TRAPD( err, psm = PowerSaveModeL() );
+    
+    if ( err != KErrNone )
+        {
+        return EFalse;
+        }
+        
+    return psm;
+    }
+
+    
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileStruct.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,258 @@
+/*
+* 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:  Data structure class for profile settings.
+*
+*/
+
+
+
+// CLASS HEADER
+#include "CProfileStruct.h"
+#include "ProfileInternal.hrh"
+
+// EXTERNAL INCLUDES
+#include <MProfileExtended.h>
+#include <MProfileName.h>
+#include <MProfileSetName.h>
+#include <MProfileTones.h>
+#include <MProfileSetTones.h>
+#include <MProfileExtraTones.h>
+#include <MProfileSetExtraTones.h>
+#include <MProfileExtraSettings.h>
+#include <MProfileSetExtraSettings.h>
+#include <MProfilePttSettings.h>
+#include <MProfileSetPttSettings.h>
+#include <AknUtils.h> // AknTextUtils
+#include <MProfileFeedbackSettings.h>
+#include <MProfileSetFeedbackSettings.h>
+#include <MProfile3DToneSettings.h>
+#include <MProfileSet3DToneSettings.h>
+
+#include <TProfileToneSettings.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileStruct::CProfileStruct
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CProfileStruct::CProfileStruct(  )
+    {
+    }
+    
+// -----------------------------------------------------------------------------
+// CProfileStruct::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProfileStruct* CProfileStruct::NewL( )
+    {
+    CProfileStruct* self = new (ELeave) CProfileStruct( );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+    
+// -----------------------------------------------------------------------------
+// CProfileStruct::ConstructL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+void CProfileStruct::ConstructL()
+	{
+	iRingingTone = new( ELeave ) TFileName();
+	iRingingToneLine2 = new( ELeave ) TFileName();
+	iVideoCallTone = new( ELeave ) TFileName();
+	iMessageAlertTone = new( ELeave ) TFileName();
+	iEmailAlertTone = new( ELeave ) TFileName();
+	iPTTRingingTone = new( ELeave ) TFileName();
+	}
+	    
+// Destructor
+CProfileStruct::~CProfileStruct()
+    {
+    iContactList.Close();
+    delete iRingingTone;
+    delete iRingingToneLine2;
+	delete iVideoCallTone;
+	delete iMessageAlertTone;
+    delete iEmailAlertTone;
+	delete iPTTRingingTone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileStruct::LoadL
+// -----------------------------------------------------------------------------
+//
+void CProfileStruct::LoadL( MProfileExtended* aProfile )
+    {
+    TArray<TContactItemId> array( aProfile->AlertForL() );
+    iContactList.Reset();
+    TInt count( array.Count() );
+    for( TInt index( 0 ); index < count; index++ )
+        {
+        iContactList.Append( array[ index ] );
+        }
+    const MProfileName& name = aProfile->ProfileName();
+    iProfileId = name.Id();
+    iProfileName.Copy( name.Name() );
+    AknTextUtils::DisplayTextLanguageSpecificNumberConversion( iProfileName );
+    iTitleName.Copy( name.TitleName() );
+    AknTextUtils::DisplayTextLanguageSpecificNumberConversion( iTitleName );
+    const MProfileTones& tones = aProfile->ProfileTones();
+    iRingingTone->Copy( tones.RingingTone1() );
+    iRingingToneLine2->Copy( tones.RingingTone2() );
+    iMessageAlertTone->Copy( tones.MessageAlertTone() );
+    const TProfileToneSettings& toneSettings = tones.ToneSettings();
+    iRingingType = toneSettings.iRingingType;
+    iKeypadVolume = toneSettings.iKeypadVolume;
+    iRingingVolume = toneSettings.iRingingVolume;
+	iMediaVolume = toneSettings.iMediaVolume;
+    iVibratingAlert = toneSettings.iVibratingAlert;
+ iEmailVibratingAlert = toneSettings.iEmailVibratingAlert;
+    iWarningAndGameTones = toneSettings.iWarningAndGameTones;
+	iTextToSpeech = toneSettings.iTextToSpeech;
+    const MProfileExtraTones& extra = aProfile->ProfileExtraTones();
+    iEmailAlertTone->Copy( extra.EmailAlertTone() );
+    iVideoCallTone->Copy( extra.VideoCallRingingTone() );
+    const MProfileExtraSettings& extraSettings = aProfile->ProfileExtraSettings();
+    const MProfilePttSettings& pttSettings = extraSettings.ProfilePttSettings();
+    iPTTRingingTone->Copy( pttSettings.PttRingingTone() );
+	iPTTStatus = pttSettings.PttStatus();
+
+    const MProfileFeedbackSettings& feedbackSettings = extraSettings.ProfileFeedbackSettings();
+    iTactileFeedback = feedbackSettings.TactileFeedback();
+    iAudioFeedback = feedbackSettings.AudioFeedback();
+	
+    const MProfile3DToneSettings& threeDSettings = extraSettings.Profile3DToneSettings();
+    i3DEffect = threeDSettings.Effect();
+    i3DEcho = threeDSettings.Echo();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileStruct::StoreL
+// -----------------------------------------------------------------------------
+//
+void CProfileStruct::StoreL( MProfileExtended* aProfile )
+    {
+    aProfile->SetAlertForL( iContactList.Array() );
+    const MProfileName& name = aProfile->ProfileName();
+    TBuf<KProfileMaxProfileNameLength> profileNameHelperBuffer;
+    profileNameHelperBuffer.Copy( name.Name() );
+    AknTextUtils::DisplayTextLanguageSpecificNumberConversion(
+            profileNameHelperBuffer );
+    if( iProfileName.Compare( profileNameHelperBuffer ) )
+        {
+        // Store profile name only if it has changed in order to
+        // preserve localisation.
+        aProfile->ProfileSetName().SetNameL( iProfileName );
+        iTitleName.Copy( iProfileName );
+        }
+    MProfileSetTones& setTones = aProfile->ProfileSetTones();
+    setTones.SetRingingTone1L( *iRingingTone );
+    setTones.SetRingingTone2L( *iRingingToneLine2 );
+    setTones.SetMessageAlertToneL( *iMessageAlertTone );
+    TProfileToneSettings& toneSettings = setTones.SetToneSettings();
+    toneSettings.iRingingType = TProfileRingingType( iRingingType );
+    toneSettings.iKeypadVolume = TProfileKeypadVolume( iKeypadVolume );
+    toneSettings.iRingingVolume = iRingingVolume;
+	toneSettings.iMediaVolume = iMediaVolume;
+    toneSettings.iVibratingAlert = iVibratingAlert;
+    toneSettings.iEmailVibratingAlert = iEmailVibratingAlert;
+    toneSettings.iWarningAndGameTones = iWarningAndGameTones;
+	toneSettings.iTextToSpeech = iTextToSpeech;
+    MProfileSetExtraTones& setExtra = aProfile->ProfileSetExtraTones();
+    setExtra.SetEmailAlertToneL( *iEmailAlertTone );
+    setExtra.SetVideoCallRingingToneL( *iVideoCallTone );
+
+    MProfileSetExtraSettings& setExtraSettings = aProfile->ProfileSetExtraSettings();
+    MProfileSetPttSettings& setPttSettings = setExtraSettings.ProfileSetPttSettings();
+	setPttSettings.SetPttRingingToneL( *iPTTRingingTone );
+	TProfilePttStatus KPttStatus = TProfilePttStatus( iPTTStatus );
+	setPttSettings.SetPttStatus( KPttStatus );
+    
+    MProfileSetFeedbackSettings& setFeedbackSettings =
+        setExtraSettings.ProfileSetFeedbackSettings();
+    TProfileTactileFeedback tactileFeedback = TProfileTactileFeedback( iTactileFeedback );
+    TProfileAudioFeedback audioFeedback = TProfileAudioFeedback( iAudioFeedback );
+    setFeedbackSettings.SetTactileFeedback( tactileFeedback );
+    setFeedbackSettings.SetAudioFeedback( audioFeedback );
+    
+    MProfileSet3DToneSettings& set3dSettings =
+        setExtraSettings.ProfileSet3DToneSettings();
+    TProfile3DToneEffect threeDEffect = TProfile3DToneEffect( i3DEffect );
+    TProfile3DToneEcho threeDEcho = TProfile3DToneEcho( i3DEcho );
+    set3dSettings.SetEffect( threeDEffect );
+    set3dSettings.SetEcho( threeDEcho );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileStruct::CompareL
+// -----------------------------------------------------------------------------
+//
+TBool CProfileStruct::CompareL( MProfileExtended* aProfile ) const
+	{
+    const MProfileTones& tones = aProfile->ProfileTones();
+    const MProfileName& name = aProfile->ProfileName();
+    const TProfileToneSettings& toneSettings = tones.ToneSettings();
+    const MProfileExtraTones& extra = aProfile->ProfileExtraTones();
+	const MProfileExtraSettings& extraSettings = aProfile->ProfileExtraSettings();
+    const MProfilePttSettings& pttSettings = extraSettings.ProfilePttSettings();
+    const MProfileFeedbackSettings& feedbackSettings = extraSettings.ProfileFeedbackSettings();    
+    const MProfile3DToneSettings& threeDSettings = extraSettings.Profile3DToneSettings();
+	
+    TArray<TContactItemId> array( aProfile->AlertForL() );
+    TInt contactArrayCount( array.Count() );
+	TInt ownContactArrayCount( iContactList.Count() );
+
+    if( ( iProfileId != name.Id() ) ||
+		( iRingingTone->Compare( tones.RingingTone1() ) ) ||
+	    ( iRingingToneLine2->Compare( tones.RingingTone2() ) ) ||
+        ( iVideoCallTone->Compare( extra.VideoCallRingingTone() ) ) ||
+		( iMessageAlertTone->Compare( tones.MessageAlertTone() ) ) ||
+		( iProfileName.Compare( name.Name() ) ) ||
+		( iRingingType != toneSettings.iRingingType ) ||
+		( iKeypadVolume != toneSettings.iKeypadVolume ) ||
+		( iRingingVolume != toneSettings.iRingingVolume ) ||
+		( iMediaVolume != toneSettings.iMediaVolume ) ||
+		( iVibratingAlert != toneSettings.iVibratingAlert ) ||
+		( iEmailVibratingAlert != toneSettings.iEmailVibratingAlert ) ||
+		( iWarningAndGameTones != toneSettings.iWarningAndGameTones ) ||
+		( iTextToSpeech != toneSettings.iTextToSpeech ) ||
+        ( iEmailAlertTone->Compare( extra.EmailAlertTone() ) ) ||
+		( ownContactArrayCount != contactArrayCount ) ||
+		( iTactileFeedback != feedbackSettings.TactileFeedback() ) ||
+		( iAudioFeedback != feedbackSettings.AudioFeedback() ) ||
+    	( i3DEffect != threeDSettings.Effect() ) ||
+		( i3DEcho != threeDSettings.Echo() ) ||
+		( iPTTRingingTone->Compare( pttSettings.PttRingingTone() ) ) ||
+		( iPTTStatus != pttSettings.PttStatus() ) )
+		{
+		return EFalse;
+		}
+
+    for( TInt index( 0 ); index < contactArrayCount; index++ )
+        {
+        if( iContactList[ index ] != array[ index ] )
+			{
+			return EFalse;
+			}
+        }
+	return ETrue;
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileStruct.h	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,172 @@
+/*
+* 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:  Data structure class for profile settings.
+*
+*/
+
+
+
+#ifndef CPROFILESTRUCT_H
+#define CPROFILESTRUCT_H
+
+// INCLUDES
+#include "ProfileEng.hrh"
+#include "ProfileInternal.hrh"
+#include <cntdef.h>
+
+// CONSTANTS
+const TInt KProfileMinVolumeLevel( 1 );
+const TInt KProfileMaxVolumeLevel( 10 );
+const TInt KProfileMaxProfileNameLength( PROFILES_MAX_NAME_LENGTH );
+
+// FORWARD DECLARATIONS
+class MProfileExtended;
+
+// CLASS DECLARATION
+/**
+*  Data structure class for profile settings.
+*  Holds settings for one profile.
+*
+*  @lib ProfileSettingsView.lib
+*  @since 1.2
+*/
+NONSHARABLE_CLASS( CProfileStruct ) : public CBase
+    {
+    public:     // Constructors and destructor
+
+		/**
+		 * Creates and returns a new instance of this class.
+		 * @return Pointer to the CProfileStruct object
+		 */
+		static CProfileStruct* NewL( );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CProfileStruct();
+	
+	private:	// Constructors
+    	/**
+        * C++ default constructor.
+        */
+        CProfileStruct();
+        
+        /**
+        * Second phase constructor
+        */
+        void ConstructL();
+        
+    public:     // New functions
+
+        /**
+        * Loads settings from Profile Engine via MProfileExtended interface to member data.
+        * @param aProfile Pointer to Profile Engine interface.
+        */
+        void LoadL( MProfileExtended* aProfile );
+
+        /**
+        * Stores member data to Profile Engine via MProfileExtended interface.
+        * @param aProfile Pointer to Profile Engine interface.
+        */
+        void StoreL( MProfileExtended* aProfile );
+
+		/**
+		* Returns ETrue if member data is the same as in aProfile.
+		* @param aProfile Profile to compare member data with.
+		* @return Returns ETrue if member data is the same as in aProfile.
+		*/
+		TBool CompareL( MProfileExtended* aProfile ) const;
+
+        /**
+        * Compares if any ringing/alarm tone setting has changed and
+        * removes it from the automated content list using DRM Helper.
+        * @param aProfile Profile to compare member data with.
+        */
+        void RemoveAutomatedContentL( MProfileExtended* aProfile ) const;
+
+    public:     // Data
+
+        // ID of the profile
+        TInt iProfileId;
+
+        // Filename of ringing tone or line 1 ringing tone
+        TFileName* iRingingTone;
+
+        // Filename of line 2 ringing tone
+        TFileName* iRingingToneLine2;
+
+        // Filename of video call tone
+        TFileName* iVideoCallTone;
+
+        // Ringing type
+        TInt iRingingType;
+
+        // Ringing volume (between KProfileMinVolumeLevel and KProfileMaxVolumeLevel)
+        TInt iRingingVolume;
+
+		// Media volume (between KProfileMinVolumeLevel and KProfileMaxVolumeLevel)
+		TInt iMediaVolume;
+
+        // Message alert tone
+        TFileName* iMessageAlertTone;
+
+        // E-mail alert tone
+        TFileName* iEmailAlertTone;
+
+        // Vibrating alert setting
+        TBool iVibratingAlert;
+
+        // Email Vibrating alert setting
+         TBool iEmailVibratingAlert;
+        // Keypad volume level
+        TInt iKeypadVolume;
+
+        // Warning and game tones setting
+        TBool iWarningAndGameTones;
+
+        // Alert for setting
+        RArray<TContactItemId> iContactList;
+
+        // Profile name
+        TBuf<KProfileMaxProfileNameLength> iProfileName;
+
+        // Profile name for title pane
+        TBuf<KProfileMaxProfileNameLength> iTitleName;
+
+		// TTS Ringingtone setting
+		TBool iTextToSpeech;
+
+		// Filename of PTT ringing tone
+        TFileName* iPTTRingingTone;
+
+        // PTT Status
+        TInt iPTTStatus;
+
+        // Tactile feedback
+        TInt iTactileFeedback;
+
+        // Audio feedback
+        TInt iAudioFeedback;
+        
+        // 3D effect
+        TInt i3DEffect;
+
+        // 3D echo
+        TInt i3DEcho;
+        
+    };
+
+#endif // CPROFILESTRUCT_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileStructDrmEmpty.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,34 @@
+/*
+* 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:  Data structure class for profile settings.
+*
+*/
+
+
+
+// CLASS HEADER
+#include "CProfileStruct.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileStruct::RemoveAutomatedContendL
+// empty implementation for variation
+// -----------------------------------------------------------------------------
+//
+void CProfileStruct::RemoveAutomatedContentL( MProfileExtended* /* aProfile */ ) const
+    {
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileStructDrmFull.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  Data structure class for profile settings.
+*
+*/
+
+
+
+// CLASS HEADER
+#include "CProfileStruct.h"
+
+// EXTERNAL INCLUDES
+#include <MProfileExtended.h>
+#include <MProfileTones.h>
+#include <MProfileExtraTones.h>
+#include <DRMHelper.h>
+#include <coemain.h>
+
+// ============================ LOCAL FUNCTIONS ================================
+
+void DoCompare( const TDesC& aOldFile, const TDesC& aNewFile, CDRMHelper& aDRMHelper )
+    {
+    if( aOldFile.CompareF( aNewFile ) != 0 )
+        {
+        // The file has been changed.
+        // Remove the old file from the automated content list.
+        // Ignore any error value. Also non-drm files are tried to be removed 
+        // so the error might be KErrNotFound.
+        //
+        // Note:
+        //   RemoveAutomatedPassive may leave even if it is not an L-method!
+        TRAP_IGNORE( aDRMHelper.RemoveAutomatedPassive( aOldFile ) ); // CSI: 59 # See the note above.
+        }
+    }
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileStruct::RemoveAutomatedContentL
+// -----------------------------------------------------------------------------
+//
+void CProfileStruct::RemoveAutomatedContentL( MProfileExtended* aProfile ) const
+    {
+    CDRMHelper* drmHelper = CDRMHelper::NewLC( *CCoeEnv::Static() );
+    const MProfileTones& tones = aProfile->ProfileTones();
+    const MProfileExtraTones& extra = aProfile->ProfileExtraTones();
+    DoCompare( tones.RingingTone1(), *iRingingTone, *drmHelper );
+    DoCompare( tones.RingingTone2(), *iRingingToneLine2, *drmHelper );
+    DoCompare( extra.VideoCallRingingTone(), *iVideoCallTone, *drmHelper );
+    DoCompare( tones.MessageAlertTone(), *iMessageAlertTone, *drmHelper );
+    DoCompare( extra.EmailAlertTone(), *iEmailAlertTone, *drmHelper );
+    CleanupStack::PopAndDestroy( drmHelper );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileTabHandler.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,208 @@
+/*
+* 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:  Tab handler for handling tabs in Profiles
+*
+*/
+
+
+
+// CLASS HDEADER
+#include "CProfileTabHandler.h"
+
+// INTERNAL INCLUDES
+#include "CProfileEngineHandler.h"
+#include "CProfileIndexHandler.h"
+#include "ProfileEngineConstants.h"
+
+// EXTERNAL INCLUDES
+#include <aknnavi.h>
+#include <coeaui.h>
+#include <akntabgrp.h>
+#include <aknnavide.h>
+#include <AknUtils.h> // AknTextUtils
+#include <MProfilesNamesArray.h>
+
+#include <MProfileName.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileTabHandler::CProfileTabHandler
+// C++ constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CProfileTabHandler::CProfileTabHandler(
+    CProfileEngineHandler& aEngineHandler,
+    CProfileIndexHandler& aIndexHandler,
+    CAknNavigationControlContainer& aNaviPane )
+    :   iEngineHandler( aEngineHandler ),
+        iIndexHandler( aIndexHandler ),
+        iNaviPane( aNaviPane )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileTabHandler::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfileTabHandler::ConstructL()
+    {
+    CreateTabGroupL();
+    iNaviPane.PushL( *iNaviDecorator );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileTabHandler::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CProfileTabHandler* CProfileTabHandler::NewL(
+    CProfileEngineHandler& aEngineHandler,
+    CProfileIndexHandler& aIndexHandler,
+    CAknNavigationControlContainer& aNaviPane )
+    {
+    CProfileTabHandler* self = new( ELeave ) CProfileTabHandler(
+        aEngineHandler, aIndexHandler, aNaviPane );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// Destructor
+CProfileTabHandler::~CProfileTabHandler()
+    {
+    if( iNaviDecorator )
+        {
+        iNaviPane.Pop( iNaviDecorator );
+        delete iNaviDecorator;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileTabHandler::TabGroup
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CAknTabGroup* CProfileTabHandler::TabGroup() const
+    {
+    return iTabGroup;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileTabHandler::SetActiveTab
+// -----------------------------------------------------------------------------
+//
+void CProfileTabHandler::SetActiveTab( TInt aIndex )
+    {
+    iTabGroup->SetActiveTabByIndex( aIndex );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileTabHandler::RefreshTabsL
+// -----------------------------------------------------------------------------
+//
+void CProfileTabHandler::RefreshTabsL()
+    {
+    MProfilesNamesArray* array = iEngineHandler.IdArray();
+    TInt count( array->MdcaCount() );
+    if( iTabGroup->TabCount() == count )
+        {
+        RBuf name;
+        name.CreateL( KProfileMaxNameLength );
+        CleanupClosePushL( name );
+        for( TInt index( 0 ); index < count; index++ )
+            {
+            name.Copy( array->ProfileName( index )->ShortName() );
+            AknTextUtils::DisplayTextLanguageSpecificNumberConversion( name );
+            iTabGroup->ReplaceTabTextL( index, name );
+            }
+        CleanupStack::PopAndDestroy( &name );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileTabHandler::SetTabObserver
+// -----------------------------------------------------------------------------
+//
+void CProfileTabHandler::SetTabObserver( MAknTabObserver* aTabObserver )
+    {
+    iTabObserver = aTabObserver;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileTabHandler::TabChangedL
+// CAknTabGroup notifies that tab has changed.
+// -----------------------------------------------------------------------------
+//
+void CProfileTabHandler::TabChangedL( TInt aIndex )
+    {
+    iIndexHandler.StoreIndices();
+    iIndexHandler.SetCurrentProfileIndex( aIndex );
+    if( iTabObserver )
+        {
+        iTabObserver->TabChangedL( aIndex );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileTabHandler::CreateTabGroupL
+// -----------------------------------------------------------------------------
+//
+void CProfileTabHandler::CreateTabGroupL()
+    {
+    // Remove all existing tabs, just in case
+    if( iNaviDecorator )
+        {
+        iNaviPane.Pop( iNaviDecorator );
+        delete iNaviDecorator;
+        iNaviDecorator = NULL;
+        }
+
+    // Create tab group
+    iNaviDecorator = iNaviPane.CreateTabGroupL( this );
+    iTabGroup = static_cast<CAknTabGroup*>( iNaviDecorator->DecoratedControl() );
+
+    MProfilesNamesArray* array = iEngineHandler.IdArray();
+
+    RBuf name;
+    name.CreateL( KProfileMaxNameLength );
+    CleanupClosePushL( name );
+    // Add tabs to tab group
+    TInt count( array->MdcaCount() );
+    for( TInt index( 0 ); index < count; index++ )
+        {
+        name.Copy( array->ProfileName( index )->ShortName() );
+        AknTextUtils::DisplayTextLanguageSpecificNumberConversion( name );
+        iTabGroup->AddTabL( index, name );
+        }
+    CleanupStack::PopAndDestroy( &name );
+    
+    // Set tab width
+    TInt tab( KTabWidthWithThreeLongTabs );
+    if( count == 1 )
+        {
+        tab = KTabWidthWithOneTab;
+        }
+    else if( count == 2 )
+        {
+        tab = KTabWidthWithTwoLongTabs;
+        }
+    iTabGroup->SetTabFixedWidthL( tab );
+
+    // Set active tab
+    iTabGroup->SetActiveTabByIndex( iIndexHandler.CurrentProfileIndex() );
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileToneHandler.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,681 @@
+/*
+* 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 interface to be used by S60 applications for
+*                setting ringing and alert tones for different profiles.
+*                Registers DRM protected tones as automated content
+*                and removes old content from automated content list.
+*                Shows a content activation query if necessary.
+*
+*/
+
+
+
+// CLASS HEADER
+#include    "cprofiletonehandler.h"
+
+// INTERNAL INCLUDES
+#include	"ProfileMmfInfoUtility.h"
+
+// EXTERNAL INCLUDES
+#include 	<centralrepository.h>
+#include    <ProfileEngineDomainCRKeys.h> // KProEngRingingToneMaxSize
+#include    <bautils.h> // BaflUtils
+#include    <apgcli.h> // RApaLsSession
+#include    <coemain.h> // CCoeEnv
+#include    <aknnotewrappers.h> // CAknInformationNote
+#include    <ConeResLoader.h> // RConeResourceLoader
+#include	<StringLoader.h>
+#include    <MProfileEngineExtended.h>
+#include    <MProfilesLocalFeatures.h>
+#include    <MProfileExtended.h>
+#include    <MProfileSetExtraTones.h>
+#include    <MProfileSetTones.h>
+#include    <MProfileExtraTones.h>
+#include    <MProfileTones.h>
+#include    <MProfilesNamesArray.h>
+#include    <MProfileName.h>
+#include    <MProfileUtilitySingleton.h>
+#include    <profilesettingsview.rsg>
+#include    <AknGlobalNote.h>
+#include    <f32file.h>
+
+namespace
+	{
+	// CONSTANTS
+	_LIT( KProfileSilentTone,     "Z:No_Sound.wav" );
+	_LIT( KProfileAudioMimeType,  "audio" );
+	_LIT( KProfileRngMimeType,    "application/vnd.nokia.ringing-tone" );
+
+	_LIT( KProfileCommonVideoType, "video/*" );
+	_LIT( KProfileRMVideoMimeType, "application/vnd.rn-realmedia" );
+	_LIT( KProfileRMVideoMimeType2, "application/x-pn-realmedia" );
+	_LIT( KProfileSDPVideoMimeType, "application/sdp" );
+	_LIT( KProfilePlainTextType, "text/plain" );
+	// The filename of the resource file
+	_LIT( KProfileResourceFileName, "Z:ProfileSettingsView.RSC" );
+	}
+
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::CProfileToneHandler
+// C++ default constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CProfileToneHandler::CProfileToneHandler()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfileToneHandler::ConstructL()
+    {
+    DrmConstructL();
+    GetMaxToneFileSizeL();
+    User::LeaveIfError( iFs.Connect() );
+    iProfileEngine = CreateProfileEngineExtendedL( &iFs );
+    // NB. Singleton must be released in the destructor:
+    iProfilesFeatures = &( ProfileUtilityInstanceL().ProfilesLocalFeatures() );
+        
+    User::LeaveIfError( iSSSettings.Open() );
+    iSSSettings.Get( ESSSettingsAls, iAlternateLineSetting ); // ignore errors
+    iSSSettings.Register( ESSSettingsAls, *this ); // ignore errors
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CProfileToneHandler* CProfileToneHandler::NewLC()
+    {
+    CProfileToneHandler* self = new( ELeave ) CProfileToneHandler();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CProfileToneHandler* CProfileToneHandler::NewL()
+    {
+    CProfileToneHandler* self = CProfileToneHandler::NewLC();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// Destructor
+CProfileToneHandler::~CProfileToneHandler()
+    {
+    iSSSettings.Close();
+    iFs.Close();
+    if( iProfileEngine )
+        {
+        iProfileEngine->Release();
+        }
+        
+    if ( iProfilesFeatures )
+        {
+        ReleaseProfileUtility();    
+        }
+    
+    ReleaseDrm();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::SetActiveProfileRingingToneL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CProfileToneHandler::SetActiveProfileRingingToneL(
+    const TDesC& aFileName )
+    {
+    // Find out the ID of the active profile
+    TInt activeProfileId(
+        User::LeaveIfError( iProfileEngine->ActiveProfileId() ) );
+
+    return SetProfileToneL(
+        activeProfileId, EProfileRingingToneSetting, aFileName );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::SetProfileToneL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CProfileToneHandler::SetProfileToneL( TInt aProfileId,
+    TProfileTones aToneSetting, const TDesC& aFileName )
+    {
+    // Check the file which is tried to set as ringing or alert tone.
+    TInt returnValue( CheckFileL( aFileName ) );
+    returnValue = CheckResultAndProtectionL( returnValue, aFileName );
+    if( returnValue != KErrNone )
+        {
+        return returnValue;
+        }
+
+    DoSetProfileToneL( aProfileId, aToneSetting, aFileName );
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::SetProfileToneNotCheckL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CProfileToneHandler::SetProfileToneNotCheckL( TInt aProfileId,
+                TProfileTones aToneSetting, const TDesC& aFileName )
+    {
+    DoSetProfileToneL( aProfileId, aToneSetting, aFileName );
+    return KErrNone;    
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::SetToneForAllProfilesL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CProfileToneHandler::SetToneForAllProfilesL(
+    TProfileTones aToneSetting, const TDesC& aFileName )
+    {
+    // Check the file which is tried to set as ringing or alert tone.
+    TInt returnValue( CheckFileL( aFileName ) );
+    returnValue = CheckResultAndProtectionL( returnValue, aFileName );
+    if( returnValue != KErrNone )
+        {
+        return returnValue;
+        }
+
+    const MProfilesNamesArray* idArray = iProfileEngine->ProfilesNamesArrayLC();
+    TInt arrayCount( idArray->MdcaCount() );
+    TInt arrayIndex( 0 );
+    TInt profileId( 0 );
+    TInt activeId( iProfileEngine->ActiveProfileId() );
+
+    // Go through profiles and update tone
+    while( arrayIndex < arrayCount )
+        {
+        profileId = idArray->ProfileName( arrayIndex )->Id();
+        // Updating of the active profile will be done last to make sure that
+        // UI gets the new value of the ringing tone if settings view is active
+        // and it is containing settings of another than active profile
+        if( profileId != activeId )
+            {
+            TRAPD(r, DoSetProfileToneL( profileId, aToneSetting, aFileName ));
+            // Filter situation when profile is not allowed to be changed
+            // e.g. Drive-profile
+            if( ( r != KErrNone ) && ( r != KErrAccessDenied ) )
+                {
+                User::Leave( r );
+                }
+            }
+        arrayIndex++;
+        }
+    CleanupStack::PopAndDestroy(); // idArray
+
+    // Update the active profile:
+    TRAPD(r, DoSetProfileToneL( activeId, aToneSetting, aFileName ));
+    // Filter situation when profile is not allowed to be changed
+    // e.g. Drive-profile
+    if( ( r != KErrNone ) && ( r != KErrAccessDenied ) )
+        {
+        User::Leave( r );
+        }
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::PhoneSettingChanged
+// Callback method inherited from MSSSettingsObserver for getting events if
+// Alternate Line Service status changes.
+// -----------------------------------------------------------------------------
+//
+void CProfileToneHandler::PhoneSettingChanged(
+    TSSSettingsSetting aSetting, TInt aNewValue )
+    {
+    if( aSetting == ESSSettingsAls )
+        {
+        iAlternateLineSetting = aNewValue;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::DoSetProfileToneL
+// -----------------------------------------------------------------------------
+//
+void CProfileToneHandler::DoSetProfileToneL( TInt aProfileId,
+    TProfileTones aToneSetting, const TDesC& aFileName )
+    {
+    // Read the settings of the profile in question
+    MProfileExtended* profile = iProfileEngine->ProfileLC( aProfileId );
+
+    // Get the old tone in order to remove it from the automated content list
+    TFileName oldTone( ReadToneL( *profile, aToneSetting ) );
+
+	TFileName fileName( aFileName );
+	if( fileName.Length() == 0 )
+        {
+        // If no filename is given, replace it with "No_sound.wav". This way
+        // it's possible to e.g. play vibra during incoming call.
+		TParse* fp = new(ELeave) TParse();
+		fp->Set(KProfileSilentTone, &KDC_RESOURCE_FILES_DIR, NULL);
+		fileName.Copy( fp->FullName() );
+		delete fp;
+        }
+
+    // Replace the old tone with the new tone
+    SetToneL( *profile, aToneSetting, fileName );
+
+    // Commit changes. Write the new settings to the Profiles Engine
+    iProfileEngine->CommitChangeL( *profile );
+
+    // Register file as automated content
+    TInt err( SetAutomated( aToneSetting, fileName ) );
+    if( err == KErrNone )
+        {
+        // Remove old tone from the automated content list
+        RemoveAutomated( oldTone );
+        }
+    else
+        {
+        // Put the old tone back into Profiles:
+        TRAP_IGNORE(
+                SetToneL( *profile, aToneSetting, oldTone );
+                iProfileEngine->CommitChangeL( *profile );
+                );
+        }
+
+    CleanupStack::PopAndDestroy(); // profile
+    User::LeaveIfError( err );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::SetToneL
+// -----------------------------------------------------------------------------
+//
+void CProfileToneHandler::SetToneL( MProfileExtended& aProfile,
+    TProfileTones aToneSetting, const TDesC& aFileName )
+    {
+    MProfileSetExtraTones& setExtraTones = aProfile.ProfileSetExtraTones();
+    MProfileSetTones& setTones = aProfile.ProfileSetTones();
+
+    switch( aToneSetting )
+        {
+        case EProfileRingingToneSetting:
+            {
+            if( iAlternateLineSetting == ESSSettingsAlsAlternate )
+                {
+                // Alternate Line Service is supported and alternate line is
+                // selected. Set as ringing tone for line 2.
+                setTones.SetRingingTone2L( aFileName );
+                }
+            else
+                {
+                // Alternate Line Service is not supported or primary line is
+                // selected. Set as ringing tone for line 1.
+                setTones.SetRingingTone1L( aFileName );
+                }
+            break;
+            }
+        case EProfileVideoCallToneSetting:
+            {
+            setExtraTones.SetVideoCallRingingToneL( aFileName );
+            break;
+            }
+        case EProfileMessageAlertToneSetting:
+            {
+            setTones.SetMessageAlertToneL( aFileName );
+            break;
+            }
+        case EProfileInstantMessageAlertToneSetting:
+            {
+            setExtraTones.SetIMMessageAlertToneL( aFileName );
+            break;
+            }
+        case EProfileEmailAlertToneSetting:
+            {
+            setExtraTones.SetEmailAlertToneL( aFileName );
+            break;
+            }
+        default:
+            {
+            User::Leave( KErrArgument );
+            break;
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::ReadToneL
+// -----------------------------------------------------------------------------
+//
+const TDesC& CProfileToneHandler::ReadToneL( const MProfileExtended& aProfile,
+    TProfileTones aToneSetting ) const
+    {
+    const MProfileExtraTones& extraTones = aProfile.ProfileExtraTones();
+    const MProfileTones& tones = aProfile.ProfileTones();
+
+    switch( aToneSetting )
+        {
+        case EProfileRingingToneSetting:
+            {
+            if( iAlternateLineSetting == ESSSettingsAlsAlternate )
+                {
+                // Alternate Line Service is supported and alternate line is
+                // selected.
+                return tones.RingingTone2();
+                }
+            else
+                {
+                // Alternate Line Service is not supported or primary line is
+                // selected.
+                return tones.RingingTone1();
+                }
+            }
+        case EProfileVideoCallToneSetting:
+            {
+            return extraTones.VideoCallRingingTone();
+            }
+        case EProfileMessageAlertToneSetting:
+            {
+            return tones.MessageAlertTone();
+            }
+        case EProfileInstantMessageAlertToneSetting:
+            {
+            return extraTones.IMMessageAlertTone();
+            }
+        case EProfileEmailAlertToneSetting:
+            {
+            return extraTones.EmailAlertTone();
+            }
+        default:
+            {
+            User::Leave( KErrArgument );
+            break;
+            }
+        }
+    return KNullDesC;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::CheckFileL
+// -----------------------------------------------------------------------------
+//
+TInt CProfileToneHandler::CheckFileL( const TDesC& aFileName )
+    {
+    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;
+        }
+
+   	TBool isAudio( EFalse );
+	TBool isVideo( EFalse );
+
+    // The file exists. Check its data (MIME) type.
+    TBuf<KMaxDataTypeLength> dataType( DataTypeL( aFileName ) );
+    if( ( dataType.Left( KProfileAudioMimeType()
+    .Length() ).CompareF( KProfileAudioMimeType ) == 0 ) ||
+		( dataType.CompareF( KProfileRngMimeType ) == 0 ) )
+    	{
+    	isAudio = ETrue;
+    	}
+
+    if( dataType.MatchF( KProfileCommonVideoType ) == 0 ||
+		dataType.CompareF( KProfileRMVideoMimeType ) == 0 ||
+		dataType.CompareF( KProfileRMVideoMimeType2 ) == 0 ||
+		dataType.CompareF( KProfileSDPVideoMimeType ) == 0 )
+        {
+#ifdef RD_VIDEO_AS_RINGING_TONE	
+        isVideo = ETrue;
+#else
+        isVideo = EFalse;
+#endif
+        }
+
+	if( (!isAudio) && (!isVideo) && (dataType.CompareF(KProfilePlainTextType) != 0) )
+		{
+	    // The data type does not start with "audio" or video and it's not RNG file.
+    	return KErrNotSupported;
+		}
+		
+	// Check whether file is supported by MMF
+	TBuf8<KMaxDataTypeLength> tempDataType;
+	tempDataType.Copy( dataType );
+    if (!ProfileMmfInfoUtility::IsMimeTypeSupportedL(tempDataType)
+			&& !ProfileMmfInfoUtility::IsHeaderDataSupportedL(aFileName))
+		{
+		// File is not supported by MMF
+		return KErrNotSupported;
+		}
+    
+	// Operator requirement. Check if the tones of this data type are blocked:
+    if( iProfilesFeatures->IsBlockedType( dataType ) ||
+        iProfilesFeatures->IsExcludedType( dataType ) )
+        {
+        User::Leave( KErrArgument );
+        }
+
+	// Check if the tone is WMDRM protected
+	if( IsFileWMDRMProtectedL( aFileName ) )
+		{
+		return KErrPermissionDenied;
+		}
+
+    TInt result( KErrNone );
+    if( IsProtected( aFileName ) )
+        {
+        // In certain variants tones of certain MIME-types are not allowed as
+        // alert tones if they are DRM-protected, check if this is one:
+        if( iProfilesFeatures->IsBlockedProtectedType( dataType ) )
+            {
+            return KErrArgument;
+            }
+        result = CheckProtectedFileL( aFileName );
+        }
+    else
+        {
+        result = iProfilesFeatures->IsBlockedUnprotectedType( dataType ) ?
+                 KErrPermissionDenied : KErrNone;
+        }
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::CheckResultAndProtectionL
+// Find out the mime type of the file
+// -----------------------------------------------------------------------------
+//
+TInt CProfileToneHandler::CheckResultAndProtectionL( TInt aResult,
+    const TDesC& aFileName )
+    {
+    if( aResult == KErrPermissionDenied || aResult == KErrNotSupported ||
+        aResult == KErrNotFound )
+        {
+        User::Leave( aResult );
+        }
+    else if( aResult != KErrNone )
+        {
+        return aResult;
+        }
+
+    // If tone file size is limited,
+    // check if this file's size exceeds this limit.
+    if ( iMaxSizeKB )
+        {
+        if ( CheckToneFileSizeL( aFileName, iMaxSizeKB ) != KErrNone )
+            {
+            ShowSizeErrorNoteL( iMaxSizeKB );
+            return KErrTooBig;
+            }
+        }
+
+    if( IsProtected( aFileName ) )
+        {
+        if( !CanSetAutomated( aFileName ) )
+            {
+            // DRM v2 content should be caught here
+            ShowErrorNoteL( R_PROFILE_TEXT_DRM_PREV_RIGHTS_SET );
+            return KErrGeneral;
+            }
+
+        // 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;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::DataType
+// Find out the mime type of the file
+// -----------------------------------------------------------------------------
+//
+TBuf<KMaxDataTypeLength> CProfileToneHandler::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.Des();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::ShowErrorNoteL
+// -----------------------------------------------------------------------------
+//
+void CProfileToneHandler::ShowErrorNoteL( TInt aResourceId ) const
+    {
+    CCoeEnv* coeEnv = CCoeEnv::Static();
+    RConeResourceLoader resourceLoader( *coeEnv );
+	CleanupClosePushL( resourceLoader );
+
+	TParse* fp = new(ELeave) TParse();
+	fp->Set(KProfileResourceFileName, &KDC_RESOURCE_FILES_DIR, NULL);
+	TFileName localizedFileName( fp->FullName() );
+	delete fp;
+
+    resourceLoader.OpenL( localizedFileName );
+
+    HBufC* errorText = StringLoader::LoadLC( aResourceId );
+    CAknInformationNote* note = new( ELeave ) CAknInformationNote( EFalse );
+    note->ExecuteLD( *errorText );
+
+	// errorText
+    CleanupStack::PopAndDestroy( errorText );
+	// resourceLoader
+	CleanupStack::PopAndDestroy( );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::ShowSizeErrorNoteL
+// -----------------------------------------------------------------------------
+//
+void CProfileToneHandler::ShowSizeErrorNoteL( TInt aSizeLimitKB )
+    {
+    CCoeEnv* coeEnv = CCoeEnv::Static();
+    RConeResourceLoader resourceLoader( *coeEnv );
+	CleanupClosePushL( resourceLoader );
+
+	TParse* fp = new(ELeave) TParse();
+	CleanupStack::PushL( fp );
+	fp->Set( KProfileResourceFileName, &KDC_RESOURCE_FILES_DIR, NULL);
+	
+	TFileName* fileName = new( ELeave ) TFileName();
+	fileName->Copy( fp->FullName() );
+	CleanupStack::PushL( fileName );
+    resourceLoader.OpenL( *fileName );
+    CleanupStack::PopAndDestroy( fileName );
+
+    HBufC* errorText = StringLoader::LoadLC(  R_PROFILE_TEXT_TONE_MAXSIZE_ERROR, aSizeLimitKB );
+    CAknInformationNote* note = new( ELeave ) CAknInformationNote( EFalse );
+    note->ExecuteLD( *errorText );
+
+    CleanupStack::PopAndDestroy( errorText );
+    CleanupStack::PopAndDestroy( fp );
+	CleanupStack::PopAndDestroy( &resourceLoader );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::GetMaxToneFileSizeL
+// -----------------------------------------------------------------------------
+//
+void CProfileToneHandler::GetMaxToneFileSizeL()
+    {
+	CRepository* cenrep = CRepository::NewL( KCRUidProfileEngine );
+	CleanupStack::PushL( cenrep );
+	TInt error = cenrep->Get( KProEngRingingToneMaxSize, iMaxSizeKB );
+	CleanupStack::PopAndDestroy( cenrep );
+	if ( error != KErrNone )
+    	{
+        iMaxSizeKB = 0;
+    	}
+	if ( iMaxSizeKB < 0 )
+	    {
+	     iMaxSizeKB = 0;
+	    }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::CheckToneFileSizeL
+// -----------------------------------------------------------------------------
+//
+TInt CProfileToneHandler::CheckToneFileSizeL( const TDesC& aFile,
+                                              TInt aSizeLimitKB )
+    {
+    // Get file size
+    TInt size = 0;
+    TInt error = KErrNone;
+
+    TEntry entry;
+    if ( iFs.Entry( aFile, entry ) == KErrNone )
+        {
+        size = entry.iSize;        
+        }
+
+	// Check. NOTE: now if file size couldn't be determined, check fails.
+	aSizeLimitKB *= KKilo;
+	if ( aSizeLimitKB  &&  size > aSizeLimitKB )
+		{
+		error = KErrTooBig;
+		}
+
+    return error;
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileToneHandlerDrmEmpty.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,107 @@
+/*
+* 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:  A helper interface to be used by S60 applications for
+*                setting ringing and alert tones for different profiles.
+*                Registers DRM protected tones as automated content
+*                and removes old content from automated content list.
+*                Shows a content activation query if necessary.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "CProfileToneHandler.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::DrmConstructL
+// 2nd phase construct for DRM objects. Empty implementation.
+// -----------------------------------------------------------------------------
+//
+void CProfileToneHandler::DrmConstructL()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::ReleaseDrm
+// Destructor for DRM objects. Empty implementation.
+// -----------------------------------------------------------------------------
+//
+void CProfileToneHandler::ReleaseDrm()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::CheckProtectedFileL
+// Empty implementation.
+// -----------------------------------------------------------------------------
+//
+TInt CProfileToneHandler::CheckProtectedFileL( const TDesC& /*aFileName*/ )
+    {
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::CanSetAutomated
+// Empty implementation.
+// -----------------------------------------------------------------------------
+//
+TBool CProfileToneHandler::CanSetAutomated( const TDesC& /*aFileName*/ )
+    {
+    return EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::AskAutomated
+// Empty implementation.
+// -----------------------------------------------------------------------------
+//
+TInt CProfileToneHandler::AskAutomated( const TDesC& /*aFileName*/ )
+    {
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::SetAutomated
+// Empty implementation.
+// -----------------------------------------------------------------------------
+//
+TInt CProfileToneHandler::SetAutomated( TProfileTones /* aToneSetting */,
+                                        const TDesC& /*aFileName*/ )
+    {
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::RemoveAutomated
+// Empty implementation.
+// -----------------------------------------------------------------------------
+//
+void CProfileToneHandler::RemoveAutomated( const TDesC& /*aFileName*/ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::IsProtected
+// Empty implementation.
+// -----------------------------------------------------------------------------
+//
+TBool CProfileToneHandler::IsProtected( const TDesC& /*aFileName*/ ) const
+    {
+    return EFalse;
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileToneHandlerDrmFull.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,497 @@
+/*
+* 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:  A helper interface to be used by S60 applications for
+*                setting ringing and alert tones for different profiles.
+*                Registers DRM protected tones as automated content
+*                and removes old content from automated content list.
+*                Shows a content activation query if necessary.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "cprofiletonehandler.h"
+
+#include    <DRMHelper.h>
+#include    <DRMCommon.h>
+#include    <profilesettingsview.rsg>
+
+#ifdef RD_DRM_COMMON_INTERFACE_FOR_OMA_AND_WMDRM
+#include	<drmutility.h>
+#include	<drmagents.h>
+#endif
+
+#include <caf/caf.h>
+
+
+// ============================ LOCAL FUNCTIONS ================================
+
+CDRMHelper::TDRMHelperAutomatedType ToneSettingToAutomatedType(
+        TProfileTones aToneSetting )
+    {
+    switch( aToneSetting )
+        {
+        case EProfileRingingToneSetting:
+            {
+            return CDRMHelper::EAutomatedTypeRingingTone;
+            }
+        case EProfileMessageAlertToneSetting:
+            {
+            return CDRMHelper::EAutomatedTypeMessageAlert;
+            }
+        case EProfileEmailAlertToneSetting:
+            {
+            return CDRMHelper::EAutomatedTypeEmailAlert;
+            }
+        case EProfileInstantMessageAlertToneSetting:
+            {
+            return CDRMHelper::EAutomatedTypeIMAlert;
+            }
+        default:
+            {
+            return CDRMHelper::EAutomatedTypeOther;
+            }
+        }
+    }
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::DrmConstructL
+// 2nd phase construct for DRM objects
+// -----------------------------------------------------------------------------
+//
+void CProfileToneHandler::DrmConstructL()
+    {
+    iDrmCommon = DRMCommon::NewL();
+    iDrmHelper = CDRMHelper::NewL();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::ReleaseDrm
+// Destructor for DRM objects
+// -----------------------------------------------------------------------------
+//
+void CProfileToneHandler::ReleaseDrm()
+    {
+    delete iDrmHelper;
+    iDrmHelper = NULL;
+    delete iDrmCommon;
+    iDrmCommon = NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::CheckProtectedFileL
+// -----------------------------------------------------------------------------
+//
+TInt CProfileToneHandler::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_PROFILE_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_PROFILE_TEXT_DRM_PREV_RIGHTS_SET );
+			break;
+			}
+
+		case DRMCommon::ENoRights:
+			{
+			iDrmHelper->HandleErrorL( DRMCommon::ENoRights, aFileName );
+			break;
+			}
+
+		default:
+			{
+			break;
+			}
+
+		}
+   
+    CleanupStack::PopAndDestroy( rights );
+
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::CanSetAutomated
+// -----------------------------------------------------------------------------
+//
+TBool CProfileToneHandler::CanSetAutomated( const TDesC& aFileName )
+    {
+    TBool canSetAutomated( EFalse );
+    return
+        iDrmHelper->CanSetAutomated( aFileName, canSetAutomated ) == KErrNone &&
+        canSetAutomated;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::AskAutomated
+// -----------------------------------------------------------------------------
+//
+TInt CProfileToneHandler::AskAutomated( const TDesC& aFileName )
+    {
+    return iDrmHelper->ShowAutomatedNote( aFileName );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::SetAutomated
+// -----------------------------------------------------------------------------
+//
+TInt CProfileToneHandler::SetAutomated( TProfileTones aToneSetting,
+                                        const TDesC& aFileName )
+    {
+    TInt err = KErrNone;
+    
+    TRAP_IGNORE( err = SetAutomatedL( aToneSetting, aFileName ) );
+
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::SetAutomatedL
+// -----------------------------------------------------------------------------
+//
+TInt CProfileToneHandler::SetAutomatedL( TProfileTones aToneSetting,
+                                        const TDesC& aFileName )
+    {
+    iDrmHelper->SetAutomatedType( ToneSettingToAutomatedType( aToneSetting ) );
+    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;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::RemoveAutomated
+// -----------------------------------------------------------------------------
+//
+void CProfileToneHandler::RemoveAutomated( const TDesC& aFileName )
+    {
+    iDrmHelper->RemoveAutomatedPassive( aFileName ); // ignore return value
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::IsProtected
+// -----------------------------------------------------------------------------
+//
+TBool CProfileToneHandler::IsProtected( const TDesC& aFileName ) const
+    {
+    TBool result = EFalse;
+    TRAP_IGNORE( result = IsProtectedL( aFileName ) );
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileToneHandler::IsProtectedL
+// -----------------------------------------------------------------------------
+//
+TBool CProfileToneHandler::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 );
+    }
+
+
+// -----------------------------------------------------------------------------
+//
+// 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
+
+// -----------------------------------------------------------------------------
+//
+// CProfileToneHandler::IsFileWMDRMProtectedL
+//
+// -----------------------------------------------------------------------------
+//
+TBool CProfileToneHandler::IsFileWMDRMProtectedL( const TDesC& aFileName )
+	{
+	TBool res = EFalse;
+	RFile hFile;
+
+	TInt err = hFile.Open( iFs, aFileName, 
+						EFileRead | EFileStream | EFileShareReadersOnly );
+	if( err == KErrInUse )
+		{
+		err = hFile.Open( iFs, 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/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileVibraSettingItem.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,49 @@
+/*
+* 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:  Setting item class for Vibra settings.
+*
+*/
+
+
+
+// INCLUDES
+#include "CProfileVibraSettingItem.h"
+#include "CProfileVibraSettingPage.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileVibraSettingItem::CProfileVibraSettingItem
+// C++ constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CProfileVibraSettingItem::CProfileVibraSettingItem(
+	TInt aIdentifier, TBool& aValue )
+	:	CAknBinaryPopupSettingItem( aIdentifier, aValue )
+	{
+	}
+
+
+// -----------------------------------------------------------------------------
+// CProfileVibraSettingItem::CreateSettingPageL
+// -----------------------------------------------------------------------------
+//
+CAknSettingPage* CProfileVibraSettingItem::CreateSettingPageL()
+	{
+	return new( ELeave ) CProfileVibraSettingPage(
+		SettingPageResourceId(),
+		*QueryValue() );
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileVibraSettingItem.h	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,65 @@
+/*
+* 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:  Setting item class for Vibra settings.
+*
+*/
+
+
+
+#ifndef CPROFILEVIBRASETTINGITEM_H
+#define CPROFILEVIBRASETTINGITEM_H
+
+// INCLUDES
+#include <aknsettingitemlist.h>
+
+// FORWARD DECLARATIONS
+class CAknSettingPage;
+
+// CLASS DECLARATION
+/**
+*  Setting item class for Vibra settings.
+*  CProfileVibraSettingItem extends CAknBinaryPopupSettingItem
+*  in order to launch CProfileVibraSettingPage
+*  instead of CAknPopupSettingPage.
+*
+*  @lib ProfileSettingsView.lib
+*  @since 5.0
+*/
+NONSHARABLE_CLASS( CProfileVibraSettingItem ) : public CAknBinaryPopupSettingItem
+	{
+	public:		// Constructors and destructor
+
+        /**
+        * C++ constructor.
+        * @param aIdentifier Setting item identifier.
+        * @param aValue Vibra setting value.
+        */
+		CProfileVibraSettingItem(
+			TInt aIdentifier,
+			TBool& aValue );
+
+	private:	// Functions from base classes
+
+        /**
+        * From CAknBinaryPopupSettingItem
+        */
+		CAknSettingPage* CreateSettingPageL();
+
+	private:	// Data
+
+	};
+
+#endif // CPROFILEVIBRASETTINGITEM_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileVibraSettingPage.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,85 @@
+/*
+* 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:  Setting page class for Vibra settings.
+*
+*/
+
+
+
+// INCLUDES
+#include <profilesettingsview.rsg>
+#include <StringLoader.h>	// For StringLoader
+#include <aknnotewrappers.h> // For CAknInformationNote
+
+// for power save mode handling
+#include <psmsettings.h>
+#include <psmsrvdomaincrkeys.h>
+#include <centralrepository.h>
+
+#include "CProfileVibraSettingPage.h"
+#include "ProfileSettingsView.hrh"
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileVibraSettingPage::CProfileVibraSettingPage
+// C++ constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CProfileVibraSettingPage::CProfileVibraSettingPage(
+    TInt aResourceID, MAknQueryValue& aQueryValue )
+    :   CAknPopupSettingPage( aResourceID, aQueryValue )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileVibraSettingPage::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfileVibraSettingPage::ConstructL()
+    {
+    CAknPopupSettingPage::ConstructL();
+    }
+
+// Destructor.
+CProfileVibraSettingPage::~CProfileVibraSettingPage()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileFeedbackSettingPage::OkToExitL
+// -----------------------------------------------------------------------------
+//
+TBool CProfileVibraSettingPage::OkToExitL( TBool aAccept )
+    {
+    if( aAccept )
+        {
+        TInt psm = EPsmsrvModeNormal;
+        CRepository* cenrep = CRepository::NewLC( KCRUidPowerSaveMode );
+        cenrep->Get( KPsmCurrentMode, psm );
+        CleanupStack::PopAndDestroy( cenrep );
+        if( psm == EPsmsrvModePowerSave )
+            {
+            HBufC* buf = StringLoader::LoadLC( R_PROFILE_TEXT_PSM_INFONOTE );
+            CAknInformationNote* queryDialog = new (ELeave) CAknInformationNote( EFalse );
+         	queryDialog->ExecuteLD( *buf );
+            CleanupStack::PopAndDestroy( buf );
+            }
+        }
+    return ETrue;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileVibraSettingPage.h	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,75 @@
+/*
+* 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:  Setting page class for Vibra settings.
+*
+*/
+
+
+
+#ifndef CPROFILEVIBRASETTINGPAGE_H
+#define CPROFILEVIBRASETTINGPAGE_H
+
+// INCLUDES
+#include <aknpopupsettingpage.h>
+
+// FORWARD DECLARATIONS
+class CFLDController;
+
+// CLASS DECLARATION
+/**
+*  Setting page class for Vibra settings.
+*  CProfileVibraSettingPage extends CAknPopupSettingPage.
+*
+*  @lib ProfileSettingsView.lib
+*  @since 5.0
+*/
+NONSHARABLE_CLASS( CProfileVibraSettingPage ) : public CAknPopupSettingPage
+	{
+	public:		// Constructors and destructor
+
+        /**
+        * C++ constructor.
+        * @param aResourceID Setting page resource ID.
+        * @param aQueryValue
+        */
+		CProfileVibraSettingPage(
+			TInt aResourceID,
+			MAknQueryValue& aQueryValue );
+
+        /**
+        * Symbian 2nd phase constructor.
+        */
+		void ConstructL();
+
+		/**
+		* Destructor.
+		*/
+		~CProfileVibraSettingPage();
+
+	private:	// Functions from base classes
+
+        /**
+        * From CAknSettingPage
+        */
+		TBool OkToExitL( TBool aAccept );
+
+	private:	// New functions
+	
+	private:	// Data
+
+	};
+
+#endif // CPROFILEVIBRASETTINGPAGE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/ProfileMmfInfoUtility.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,159 @@
+/*
+* 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.
+*
+*/
+
+
+
+// CLASS HEADER
+#include    "ProfileMmfInfoUtility.h"
+
+// INTERNAL INCLUDES
+
+// EXTERNAL INCLUDES
+#include <e32std.h>
+#include <badesca.h>
+#include <mmf/common/mmfcontrollerpluginresolver.h>
+#include <caf/caf.h>
+namespace
+	{
+	// CONSTANTS
+	_LIT8( KProfileRngMimeType,    "application/vnd.nokia.ringing-tone" );
+	//_LIT8( KProfilePlainTextType,  "text/plain" );
+    }
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileMmfInfoUtility::IsMimeTypeSupported
+// -----------------------------------------------------------------------------
+//
+TBool ProfileMmfInfoUtility::IsMimeTypeSupportedL( const TDesC8& aMimeType )
+    {
+
+    //if( aMimeType.CompareF( KProfilePlainTextType ) == 0 )
+    //    {
+    //    return EFalse;
+    //    }
+
+    if( aMimeType.CompareF( KProfileRngMimeType ) == 0 )
+        {
+        return ETrue;
+        }
+
+    TBool result( EFalse );
+
+	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 );
+
+    for( TInt i( cntrlArray.Count() - 1 ); i >= 0 && !result; --i )
+        {
+        const RMMFFormatImplInfoArray&
+            infoArray( cntrlArray[i]->PlayFormats() );
+
+        for( TInt j( infoArray.Count() - 1 ); j >= 0; --j )
+            {
+            if( infoArray[j]->SupportsMimeType( aMimeType ) )
+                {
+                result = ETrue;
+                break;
+                }
+            }
+        }
+	
+	cntrlArray.ResetAndDestroy();
+	cntrlArray.Close();
+    CleanupStack::PopAndDestroy( 2, formatPrms );
+
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileMmfInfoUtility::IsHeaderDataSupportedL
+// -----------------------------------------------------------------------------
+//
+TBool ProfileMmfInfoUtility::IsHeaderDataSupportedL( const TDesC& aFileName )
+	{
+	TBool result( EFalse );
+	//the max header length is 256 bytes
+	const TInt KMaxHeaderLength( 256 );
+	HBufC8* header = HBufC8::NewLC( KMaxHeaderLength );
+	TPtr8 headerPtr = header->Des();
+	GetFileHeaderDataL( aFileName, headerPtr, KMaxHeaderLength );
+	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 );
+
+	for ( TInt i( cntrlArray.Count() - 1 ); i >= 0 && !result; --i )
+		{
+		const RMMFFormatImplInfoArray& infoArray( cntrlArray[i]->PlayFormats() );
+
+		for ( TInt j(infoArray.Count() - 1); j >= 0; --j )
+			{
+			if ( infoArray[j]->SupportsHeaderDataL( *header ) )
+				{
+				result = ETrue;
+				break;
+				}
+			}
+		}
+
+	cntrlArray.ResetAndDestroy();
+	cntrlArray.Close();
+	CleanupStack::PopAndDestroy( 3, header );//controllerPrms, formatPrms and header
+
+	return result;
+	}
+
+// -----------------------------------------------------------------------------
+// CProfileMmfInfoUtility::GetFileHeaderDataL
+// -----------------------------------------------------------------------------
+//
+void ProfileMmfInfoUtility::GetFileHeaderDataL( const TDesC& aFileName,
+		TDes8& aHeaderData, TInt aMaxHeaderLength )
+	{
+	TInt error = KErrNone;
+	using namespace ContentAccess;
+	TVirtualPathPtr path( aFileName, ContentAccess::KDefaultContentObject );
+	CData* data = CData::NewLC( path, EContentShareReadWrite );
+	TInt size = 0;
+	data->DataSizeL( size );
+	if ( size > 0 )
+		{
+		if ( size > aMaxHeaderLength )
+			size = aMaxHeaderLength;
+		TInt pos = 0;
+		error = data->Seek( ESeekStart, pos );
+		error = data->Read( aHeaderData, size );
+		}
+	CleanupStack::PopAndDestroy(); // data
+	}
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/ProfileMmfInfoUtility.h	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,81 @@
+/*
+* 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 PROFILEMMFINFOUTILITY_H
+#define PROFILEMMFINFOUTILITY_H
+
+//  INCLUDES
+#include <e32std.h>
+
+// CLASS DECLARATION
+
+/**
+*  A helper interface used by CProfileToneHandler to check whether a MIME
+*  type is supported by MMF.
+*
+*  @lib ProfileSettingsView.lib
+*  @since Series 60 3.0
+*/
+class ProfileMmfInfoUtility
+    {
+    public: // New functions
+
+        /**
+         * Checks if the given MIME-type is supported by MMF. In other words,
+         * checks if there is an MMF plugin to handle the given MIME type.
+         * @param aMimeType the MIME type for which an MMF plugin is searched.
+         * @return ETrue if the given MIME is supported by MMF,
+         *         EFalse otherwise.
+         */
+        static TBool IsMimeTypeSupportedL( const TDesC8& aMimeType );
+        
+        /**
+         * Checks if the given file's header data is supported 
+         * by MMF, especially for m4a drm files.
+         * @param aFileName the name of the file to be judged.
+         * @return ETrue if the given file is supported by MMF,
+         *         EFalse otherwise.
+         */
+        static TBool IsHeaderDataSupportedL( const TDesC& aFileName );
+
+    private:  // Constructor and destructor
+
+        /**
+         * Default constructor. This is private since this class is not intended
+         * to be instantiated.
+         */
+        ProfileMmfInfoUtility() {};
+
+        // Destructor.
+        ~ProfileMmfInfoUtility() {};
+        
+        //internal use
+        /**
+         * Get the header data of the file
+         * @param aFileName specifies the name of the file.
+         * @param aHeaderData contains the header data of the file.
+         * @param aMaxLength the length of header data.         
+         */
+        static void GetFileHeaderDataL(const TDesC& aFileName, TDes8& aHeaderData, TInt aMaxLength);
+    };
+
+#endif      // PROFILEMMFINFOUTILITY_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/ProfilePanics.h	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,37 @@
+/*
+* 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 codes of Profiles application.
+*
+*/
+
+
+
+#ifndef PROFILEPANICS_H
+#define PROFILEPANICS_H
+
+/**
+* Enumerations for panics of Profiles application.
+*/
+enum TProfilePanics
+	{
+	EProfilePanicInvalidSettingItemId,
+	EProfilePanicProfileIndexOutOfRange,
+	EProfilePanicNoProfiles
+	};
+
+_LIT( KProfilePanicText, "ProfileApp" );
+
+#endif // PROFILEPANICS_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/ProfileSettingsView.hrh	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  Resource headers of Profile Settings View
+*
+*/
+
+
+
+#ifndef PROFILESETTINGSVIEW_HRH
+#define PROFILESETTINGSVIEW_HRH
+
+// DATA TYPES
+enum TProfileSettingItemIds
+    {
+    EProfileSettingRingingToneId = 0,
+    EProfileSettingRingingToneLine1Id,
+    EProfileSettingRingingToneLine2Id,
+    EProfileSettingVideoCallToneId,
+    EProfileSettingRingingTypeId,
+    EProfileSettingRingingVolumeId,
+    EProfileSettingMediaVolumeId,
+    EProfileSettingMessageAlertToneId,
+    EProfileSettingEmailAlertToneId,
+    EProfileSettingVibratingAlertId,
+    EProfileSettingEmailVibratingAlertId,
+    EProfileSettingKeypadVolumeId,
+    EProfileSettingWarningAndGameTonesId,
+    EProfileSettingAlertForId,
+    EProfileSettingProfileNameId,
+    EProfileSettingTTSRingingToneId,
+    EProfileSettingPTTRingingToneId,
+    EProfileSettingPTTStatusId,
+    EProfileSetting3dEffectId,
+    EProfileSetting3dEchoId,
+    EProfileSettingTactileFeedbackId,
+    EProfileSettingAudioFeedbackId
+    };
+
+enum TProfileControlIds
+    {
+    EProfileControlIdConfirmationNote = 1
+    };
+
+#endif // PROFILESETTINGSVIEW_HRH
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/ProfileSettingsView.rss	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,401 @@
+/*
+* 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 Settings View resources
+*
+*/
+
+
+
+//  RESOURCE IDENTIFIER
+NAME    PRO2
+
+// INTERNAL INCLUDES
+#include <profileapp.loc>
+#include <Profile.loc>
+#include "ProfileSettingsView.hrh"
+#include "ProfileInternal.hrh"
+
+// EXTERNAL INCLUDES
+#include <eikon.rh>
+#include <avkon.rh>
+#include <avkon.rsg>
+#include <avkon.loc>
+#include <avkon.mbg>
+#include <AvkonIcons.hrh>
+#include <drmcommon.loc>
+#include <e32keys.h>
+#include <bldvariant.hrh> 
+#include <ProfileEng.hrh>
+#include <Profile.hrh>
+
+//  RESOURCE DEFINITIONS
+
+RESOURCE RSS_SIGNATURE {}
+
+RESOURCE TBUF { buf = ""; }
+
+RESOURCE EIK_APP_INFO {}
+
+// Include the common part of the resources (of application and plugin):
+#include "ProfileSettingsViewCommon.rss"
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_setting_item_list
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_SETTING_ITEM_LIST r_profile_setting_item_list
+    {
+    items =
+        {
+        AVKON_SETTING_ITEM
+            {
+            identifier = EProfileSettingRingingToneId;
+            name = qtn_mode_ringing_tone;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EProfileSettingRingingToneLine1Id;
+            name = qtn_mode_line1_tone;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EProfileSettingRingingToneLine2Id;
+            name = qtn_mode_line2_tone;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EProfileSettingRingingTypeId;
+            name = qtn_mode_ringing_type_2;
+            setting_page_resource = r_profile_ringing_type_setting_page;
+            associated_resource = r_profile_ringing_type_setting_texts;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EProfileSettingRingingVolumeId;
+            name = qtn_mode_ringing_volume;
+            setting_page_resource = r_profile_ringing_volume_setting_page;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EProfileSettingMediaVolumeId;
+            name = qtn_profiles_media_volume;
+            setting_page_resource = r_profile_media_volume_setting_page;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EProfileSettingMessageAlertToneId;
+            name = qtn_mode_message_tone;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EProfileSettingKeypadVolumeId;
+            name = qtn_mode_keypad_volume;
+            setting_page_resource = r_profile_keypad_volume_setting_page;
+            associated_resource = r_profile_keypad_volume_setting_texts;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EProfileSettingVibratingAlertId;
+            name = qtn_mode_vibrating_alert;
+            setting_page_resource = r_profile_vibrating_alert_setting_page;
+            associated_resource = r_profile_vibrating_alert_setting_texts;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EProfileSettingEmailVibratingAlertId;
+            name = qtn_profiles_email_vibra;
+            setting_page_resource = r_profile_email_vibrating_alert_setting_page;
+            associated_resource = r_profile_email_vibrating_alert_setting_texts;
+            },            
+        AVKON_SETTING_ITEM
+            {
+            identifier = EProfileSettingVideoCallToneId;
+            name = qtn_mode_vt_tone;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EProfileSettingEmailAlertToneId;
+            name = qtn_profiles_e_mail_tone;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EProfileSettingWarningAndGameTonesId;
+            name = qtn_mode_warning_game;
+            setting_page_resource = r_profile_warning_tones_setting_page;
+            associated_resource = r_profile_warning_alert_setting_texts;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EProfileSettingTTSRingingToneId;
+            name = qtn_mode_tts_ringing_tone;
+            setting_page_resource = r_profile_tts_tones_setting_page;
+            associated_resource = r_profile_tts_setting_texts;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EProfileSetting3dEffectId;
+            name = qtn_profiles_tone_3d_effect;
+            setting_page_resource = r_profile_3d_effect_setting_page;
+            associated_resource = r_profile_3d_effect_setting_texts;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EProfileSetting3dEchoId;
+            name = qtn_profiles_tone_3d_echo;
+            setting_page_resource = r_profile_3d_echo_setting_page;
+            associated_resource = r_profile_3d_echo_setting_texts;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EProfileSettingTactileFeedbackId;
+            name = qtn_mode_tactile_feedback;
+            setting_page_resource = r_profile_tactile_feedback_setting_page;
+            associated_resource = r_profile_tactile_feedback_setting_texts;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EProfileSettingAudioFeedbackId;
+            name = qtn_mode_audio_feedback;
+            setting_page_resource = r_profile_audio_feedback_setting_page;
+            associated_resource = r_profile_audio_feedback_setting_texts;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EProfileSettingAlertForId;
+            name = qtn_mode_alert_for;
+            setting_page_resource = r_profile_alert_for_setting_page;
+            },            
+       AVKON_SETTING_ITEM
+            {
+            identifier = EProfileSettingPTTRingingToneId;
+            name = qtn_poc_profile_ringing_tone;
+            },
+       	AVKON_SETTING_ITEM
+            {
+            identifier = EProfileSettingPTTStatusId;
+            name = qtn_poc_profile_status;
+            setting_page_resource = r_profile_ptt_status_setting_page;
+            associated_resource = r_profile_ptt_status_setting_texts;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EProfileSettingProfileNameId;
+            name = qtn_mode_sett_profile_name;
+            setting_page_resource = r_profile_name_setting_page;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_alert_for_setting_page
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_profile_alert_for_setting_page
+    {
+    label = qtn_mode_alert_for;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__UNMARK;
+    type = EAknSetListBox;
+    editor_resource_id = r_profile_alert_for_control;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_alert_for_control
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE LISTBOX r_profile_alert_for_control
+    {
+    flags = EEikListBoxMultipleSelection;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_name_setting_page
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_profile_name_setting_page
+    {
+    label = qtn_mode_sett_profile_name;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type = EEikCtEdwin;
+    editor_resource_id = r_profile_name_control;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_name_control
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE EDWIN r_profile_name_control
+    {
+    flags = EEikEdwinNoLineOrParaBreaks;
+    width = 9;
+    lines = 5;
+    maxlength = PROFILES_MAX_NAME_LENGTH;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_media_volume_setting_page
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_profile_media_volume_setting_page
+    {
+    label = qtn_profiles_media_volume;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type = EAknCtVolumeControl;
+    editor_resource_id = r_profile_ringing_volume_control;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_ptt_status_setting_page
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_profile_ptt_status_setting_page
+    {
+    label = qtn_mode_ringing_type_2;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type = EAknCtPopupSettingList;
+    editor_resource_id = r_profile_empty_popup_setting_list_control;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_ptt_status_setting_texts
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_POPUP_SETTING_TEXTS r_profile_ptt_status_setting_texts
+    {
+    setting_texts_resource = r_profile_ptt_status_texts_and_values;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_ptt_status_texts_and_values
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_profile_ptt_status_texts_and_values
+    {
+    items =
+        {
+        AVKON_ENUMERATED_TEXT {
+         value = EProfilePttActive;     text = qtn_poc_profile_status_active; },
+        AVKON_ENUMERATED_TEXT {
+         value = EProfilePttSilent;   text = qtn_poc_profile_status_silent; },
+        AVKON_ENUMERATED_TEXT {
+         value = EProfilePttDoNotDisturb; text = qtn_poc_profile_status_dnd; }
+        };
+    }
+    
+
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_text_all_callers
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_profile_text_all_callers { buf = qtn_tc_all_callers; }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_text_several_groups
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_profile_text_several_groups { buf = qtn_tc_several_groups; }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_text_rename_error
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_profile_text_rename_error { buf = qtn_mode_rename_error; }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_confirm_ringtone_found
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_profile_confirm_ringtone_found {
+ buf = qtn_profiles_confirm_ringtone_found; }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_confirm_ringtone_found_query
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_profile_confirm_ringtone_found_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_EMPTY;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control = AVKON_CONFIRMATION_QUERY
+                {
+                layout = EConfirmationQueryLayout;
+                label = "";
+                bmpfile = AVKON_BITMAP_FILE;
+                bmpid = EMbmAvkonQgn_note_info;
+                bmpmask = EMbmAvkonQgn_note_info_mask;
+                };
+            }
+        };
+    } 
+
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_text_psm_infonote
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_profile_text_psm_infonote { buf = qtn_power_saving_protected_settings_infonote; }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/ProfileSettingsViewCommon.rss	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,571 @@
+/*
+* 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:  Common part of Profiles Settings View/Profiles GS Tones view
+*                plugin resources. Note, that this should always be compiled as
+*                a part of resources (settings view or plugin).
+*
+*/
+
+#include <mediafilelist.loc>
+
+//  RESOURCE DEFINITIONS
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_empty_popup_setting_list_control
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE POPUP_SETTING_LIST r_profile_empty_popup_setting_list_control
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_ringing_type_setting_page
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_profile_ringing_type_setting_page
+    {
+    label = qtn_mode_ringing_type_2;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type = EAknCtPopupSettingList;
+    editor_resource_id = r_profile_empty_popup_setting_list_control;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_ringing_type_setting_texts
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_POPUP_SETTING_TEXTS r_profile_ringing_type_setting_texts
+    {
+    setting_texts_resource = r_profile_ringing_type_texts_and_values;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_ringing_type_texts_and_values
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_profile_ringing_type_texts_and_values
+    {
+    items =
+        {
+        AVKON_ENUMERATED_TEXT { value = EProfileRingingTypeRinging;     text = qtn_tc_ringing; },
+        AVKON_ENUMERATED_TEXT { value = EProfileRingingTypeAscending;   text = qtn_tc_ascending; },
+        AVKON_ENUMERATED_TEXT { value = EProfileRingingTypeRingingOnce; text = qtn_tc_ring_once; },
+        AVKON_ENUMERATED_TEXT { value = EProfileRingingTypeBeepOnce;    text = qtn_tc_beep_once; }
+//CDMA doesn't have silent ringingtype
+#ifndef __PROTOCOL_CDMA
+       ,AVKON_ENUMERATED_TEXT { value = EProfileRingingTypeSilent;      text = qtn_tc_silent; }
+#endif
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_ringing_volume_setting_page
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_profile_ringing_volume_setting_page
+    {
+    label = qtn_mode_ringing_volume;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type = EAknCtVolumeControl;
+    editor_resource_id = r_profile_ringing_volume_control;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_ringing_volume_control
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE VOLUME r_profile_ringing_volume_control
+    {
+    flags = ESettingsVolumeControl;
+    value = 7; // Has to have a value, otherwise crashes
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_vibrating_alert_setting_page
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_profile_vibrating_alert_setting_page
+    {
+    label = qtn_mode_vibrating_alert;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type = EAknCtPopupSettingList;
+    editor_resource_id = r_profile_empty_popup_setting_list_control;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_vibrating_alert_setting_texts
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_POPUP_SETTING_TEXTS r_profile_vibrating_alert_setting_texts
+    {
+    setting_texts_resource = r_profile_vibrating_alert_texts_and_values;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_vibrating_alert_texts_and_values
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_profile_vibrating_alert_texts_and_values
+    {
+    items =
+        {
+        AVKON_ENUMERATED_TEXT { value = 1;  text = qtn_mode_vibrating_alert_on; },
+        AVKON_ENUMERATED_TEXT { value = 0;  text = qtn_mode_vibrating_alert_off; }
+        };
+    }
+
+RESOURCE AVKON_SETTING_PAGE r_profile_email_vibrating_alert_setting_page
+    {
+    label =qtn_profiles_email_vibra;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type = EAknCtPopupSettingList;
+    editor_resource_id = r_profile_empty_popup_setting_list_control;
+    }
+// -----------------------------------------------------------------------------
+//
+// r_profile_vibrating_email_alert_setting_texts
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_POPUP_SETTING_TEXTS r_profile_email_vibrating_alert_setting_texts
+    {
+    setting_texts_resource = r_profile_email_vibrating_alert_texts_and_values;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_email_vibrating_alert_texts_and_values
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_profile_email_vibrating_alert_texts_and_values
+    {
+    items =
+        {
+        AVKON_ENUMERATED_TEXT { value = 1;  text = qtn_mode_email_vibra_on; },
+        AVKON_ENUMERATED_TEXT { value = 0;  text = qtn_mode_email_vibra_off; }
+        };
+    }
+// -----------------------------------------------------------------------------
+//
+// r_profile_tactile_feedback_setting_page
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_profile_tactile_feedback_setting_page
+    {
+    label = qtn_mode_tactile_feedback;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type = EAknCtPopupSettingList;
+    editor_resource_id = r_profile_empty_popup_setting_list_control;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_tactile_feedback_setting_texts
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_POPUP_SETTING_TEXTS r_profile_tactile_feedback_setting_texts
+    {
+    setting_texts_resource = r_profile_tactile_feedback_texts_and_values;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_tactile_feedback_texts_and_values
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_profile_tactile_feedback_texts_and_values
+    {
+    items =
+        {
+        AVKON_ENUMERATED_TEXT { value = EProfileTactileFeedbackOff;    text = qtn_mode_tactile_feedback_off; },
+        AVKON_ENUMERATED_TEXT { value = EProfileTactileFeedbackLevel1; text = qtn_mode_tactile_feedback_level1; },
+        AVKON_ENUMERATED_TEXT { value = EProfileTactileFeedbackLevel2; text = qtn_mode_tactile_feedback_level2; },
+        AVKON_ENUMERATED_TEXT { value = EProfileTactileFeedbackLevel3; text = qtn_mode_tactile_feedback_level3; }
+        };
+    }
+// -----------------------------------------------------------------------------
+//
+// r_profile_audio_feedback_setting_page
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_profile_audio_feedback_setting_page
+    {
+    label = qtn_mode_audio_feedback;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type = EAknCtPopupSettingList;
+    editor_resource_id = r_profile_empty_popup_setting_list_control;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_audio_feedback_setting_texts
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_POPUP_SETTING_TEXTS r_profile_audio_feedback_setting_texts
+    {
+    setting_texts_resource = r_profile_audio_feedback_texts_and_values;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_audio_feedback_texts_and_values
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_profile_audio_feedback_texts_and_values
+    {
+    items =
+        {
+        AVKON_ENUMERATED_TEXT { value = EProfileAudioFeedbackOff;    text = qtn_mode_audio_feedback_off; },
+        AVKON_ENUMERATED_TEXT { value = EProfileAudioFeedbackLevel1; text = qtn_mode_audio_feedback_level1; },
+        AVKON_ENUMERATED_TEXT { value = EProfileAudioFeedbackLevel2; text = qtn_mode_audio_feedback_level2; },
+        AVKON_ENUMERATED_TEXT { value = EProfileAudioFeedbackLevel3; text = qtn_mode_audio_feedback_level3; }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_warning_alert_setting_texts
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_POPUP_SETTING_TEXTS r_profile_warning_alert_setting_texts
+    {
+    setting_texts_resource = r_profile_warning_alert_texts_and_values;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_warning_alert_texts_and_values
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_profile_warning_alert_texts_and_values
+    {
+    items =
+        {
+        AVKON_ENUMERATED_TEXT { value = 1;  text = qtn_mode_warning_game_on; },
+        AVKON_ENUMERATED_TEXT { value = 0;  text = qtn_mode_warning_game_off; }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_tts_setting_texts
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_POPUP_SETTING_TEXTS r_profile_tts_setting_texts
+    {
+    setting_texts_resource = r_profile_tts_texts_and_values;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_tts_texts_and_values
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_profile_tts_texts_and_values
+    {
+    items =
+        {
+        AVKON_ENUMERATED_TEXT { value = 1;  text = qtn_mode_tts_ringing_tone_on; },
+        AVKON_ENUMERATED_TEXT { value = 0;  text = qtn_mode_tts_ringing_tone_off; }
+        };
+    }
+// -----------------------------------------------------------------------------
+//
+// r_profile_keypad_volume_setting_page
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_profile_keypad_volume_setting_page
+    {
+    label = qtn_mode_keypad_volume;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type = EAknCtPopupSettingList;
+    editor_resource_id = r_profile_empty_popup_setting_list_control;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_keypad_volume_setting_texts
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_POPUP_SETTING_TEXTS r_profile_keypad_volume_setting_texts
+    {
+    setting_texts_resource = r_profile_keypad_volume_texts_and_values;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_keypad_volume_texts_and_values
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_profile_keypad_volume_texts_and_values
+    {
+    items =
+        {
+        AVKON_ENUMERATED_TEXT { value = EProfileKeypadVolumeOff;    text = qtn_tc_keypad_off; },
+        AVKON_ENUMERATED_TEXT { value = EProfileKeypadVolumeLevel1; text = qtn_tc_keypad_quiet; },
+        AVKON_ENUMERATED_TEXT { value = EProfileKeypadVolumeLevel2; text = qtn_tc_keypad_medium; },
+        AVKON_ENUMERATED_TEXT { value = EProfileKeypadVolumeLevel3; text = qtn_tc_keypad_loud; }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_warning_tones_setting_page
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_profile_warning_tones_setting_page
+    {
+    label = qtn_mode_warning_game;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type = EAknCtPopupSettingList;
+    editor_resource_id = r_profile_empty_popup_setting_list_control;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_tts_tones_setting_page
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_profile_tts_tones_setting_page
+    {
+    label = qtn_mode_tts_ringing_tone;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type = EAknCtPopupSettingList;
+    editor_resource_id = r_profile_empty_popup_setting_list_control;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_3d_effect_setting_page
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_profile_3d_effect_setting_page
+    {
+    label = qtn_profiles_tone_3d_effect;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type = EAknCtPopupSettingList;
+    editor_resource_id = r_profile_empty_popup_setting_list_control;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_3d_effect_setting_texts
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_POPUP_SETTING_TEXTS r_profile_3d_effect_setting_texts
+    {
+    setting_texts_resource = r_profile_3d_effect_texts_and_values;
+    }
+   
+// -----------------------------------------------------------------------------
+//
+// r_profile_3d_effect_texts_and_values
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_profile_3d_effect_texts_and_values
+    {
+    items =
+        {
+        AVKON_ENUMERATED_TEXT { value = EProfile3DEffectOff;     text = qtn_profiles_3d_effect_off; },
+        AVKON_ENUMERATED_TEXT { value = EProfile3DEffectCircle;  text = qtn_profiles_3d_effect_circle; },
+        AVKON_ENUMERATED_TEXT { value = EProfile3DEffectFlyby;  text = qtn_profiles_3d_effect_flyby; },
+        AVKON_ENUMERATED_TEXT { value = EProfile3DEffectZigZag;  text = qtn_profiles_3d_effect_zig_zag; },
+        AVKON_ENUMERATED_TEXT { value = EProfile3DEffectRandomWalk;  text = qtn_profiles_3d_effect_random_walk; },
+        AVKON_ENUMERATED_TEXT { value = EProfile3DEffectChaos;  text = qtn_profiles_3d_effect_chaos; }
+
+#ifdef __STEREO_WIDENING_EFFECT_UI
+        ,AVKON_ENUMERATED_TEXT { value = EProfile3DEffectStereoWidening;  text = qtn_profiles_3d_effect_stereo_widening; }
+#endif
+
+        };
+    }    
+    
+// -----------------------------------------------------------------------------
+//
+// r_profile_3d_echo_setting_page
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_profile_3d_echo_setting_page
+    {
+    label = qtn_profiles_tone_3d_echo;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type = EAknCtPopupSettingList;
+    editor_resource_id = r_profile_empty_popup_setting_list_control;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_3d_echo_setting_texts
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_POPUP_SETTING_TEXTS r_profile_3d_echo_setting_texts
+    {
+    setting_texts_resource = r_profile_3d_echo_texts_and_values;
+    }
+   
+// -----------------------------------------------------------------------------
+//
+// r_profile_3d_echo_texts_and_values
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_profile_3d_echo_texts_and_values
+    {
+    items =
+        {
+        AVKON_ENUMERATED_TEXT { value = EProfile3DEchoOff;     text = qtn_profiles_3d_echo_off; },
+        AVKON_ENUMERATED_TEXT { value = EProfile3DEchoLivingRoom;  text = qtn_profiles_3d_echo_living_room; },
+        AVKON_ENUMERATED_TEXT { value = EProfile3DEchoCave;  text = qtn_profiles_3d_echo_cave; },
+        AVKON_ENUMERATED_TEXT { value = EProfile3DEchoStoneCorridor;  text = qtn_profiles_3d_echo_stone_corridor; },
+        AVKON_ENUMERATED_TEXT { value = EProfile3DEchoForest;  text = qtn_profiles_3d_echo_forest; },
+        AVKON_ENUMERATED_TEXT { value = EProfile3DEchoSewerPipe;  text = qtn_profiles_3d_echo_sewer_pipe; },
+        AVKON_ENUMERATED_TEXT { value = EProfile3DEchoUnderwater;  text = qtn_profiles_3d_echo_underwater; }
+        };
+    }    
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_volume_confirmation_query
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_profile_volume_confirmation_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_YES_NO;
+    items=
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control = AVKON_CONFIRMATION_QUERY
+                {
+                layout = EConfirmationQueryLayout;
+                label = qtn_tc_ringing_level_warning;
+                };
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_text_select_tone
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_profile_text_select_tone { buf = qtn_tc_popup_heading; }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_text_none
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_profile_text_none { buf = qtn_tsl_off; }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_text_drm_prev_rights_set
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_profile_text_drm_prev_rights_set { buf = qtn_drm_prev_rights_set; }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_text_tone_maxsize_error
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_profile_text_tone_maxsize_error { buf = qtn_profiles_tone_maxsize_error; }
+	
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/UIsrc/CProfileAppUi.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,117 @@
+/*
+* 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:  Application UI class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "CProfileAppUi.h"
+
+#include <hlplch.h>
+#include <CProfileEngineHandler.h>
+
+#include "CProfileMainView.h"
+#include "CProfileSettingsView.h"
+#include "ProfileApp.hrh"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileAppUi::CProfileAppUi
+// C++ constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CProfileAppUi::CProfileAppUi(
+    CProfileEngineHandler& aEngineHandler,
+    CProfileIndexHandler& aIndexHandler )
+    :   iEngineHandler( aEngineHandler ),
+        iIndexHandler( aIndexHandler )
+    {
+    }
+
+// Destructor
+CProfileAppUi::~CProfileAppUi()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileAppUi::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfileAppUi::ConstructL()
+    {
+    BaseConstructL( EAknEnableSkin | EAknEnableMSK |EAknSingleClickCompatible);
+
+	CProfileMainView* mainView = 
+        CProfileMainView::NewLC( iEngineHandler, iIndexHandler );
+    AddViewL( mainView ); // transfer ownership to CAknViewAppUi
+    SetDefaultViewL( *mainView );
+    CleanupStack::Pop( mainView);
+    iMainView = mainView;
+
+	CProfileSettingsView* settingsView =
+	 CProfileSettingsView::NewLC(
+        iEngineHandler, iIndexHandler);
+    AddViewL( settingsView ); // transfer ownership to CAknViewAppUi
+    CleanupStack::Pop( settingsView ); // iSettingsView
+    iSettingsView = settingsView;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileAppUi::HandleCommandL
+// -----------------------------------------------------------------------------
+//
+void CProfileAppUi::HandleCommandL( TInt aCommand )
+    {
+    switch( aCommand )
+        {
+        case EAknSoftkeyBack: // Back from Settings view
+            {
+            if ( iView == iMainView )
+                {
+                Exit();  // Back from Settings view
+                break;
+                }
+            ActivateLocalViewL( iMainView->Id() );
+            break;
+            }
+        case EProfileCmdPersonalise: // Personalise from Main view
+            {
+            ActivateLocalViewL( iSettingsView->Id() );
+            break;
+            }
+        // FALLTHROUGH for PC Lint
+        // Exit from options menu and exit from right softkey do the same thing.
+        case EEikCmdExit:
+        case EAknSoftkeyExit:
+            {
+            Exit();
+            break;
+            }
+        case EAknCmdHelp:
+            {
+            HlpLauncher::LaunchHelpApplicationL(
+                iEikonEnv->WsSession(), AppHelpContextL() );
+            break;
+            }
+        default:
+            {
+            break;
+            }
+        }
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/UIsrc/CProfileAppUi.h	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  Application UI class.
+*
+*/
+
+
+
+#ifndef CPROFILEAPPUI_H
+#define CPROFILEAPPUI_H
+
+// INCLUDES
+#include <aknViewAppUi.h>
+
+// FORWARD DECLARATIONS
+class CProfileMainView;
+class CProfileSettingsView;
+class CProfileEngineHandler;
+class CProfileIndexHandler;
+
+// CLASS DECLARATION
+/**
+*  Application UI class.
+*  CProfileAppUi instantiates two views and
+*  implements view switching and command handling.
+*  The views are owned by the base class.
+*
+*  @lib ProfileApp.app
+*  @since 1.2
+*/
+NONSHARABLE_CLASS( CProfileAppUi ) : public CAknViewAppUi
+    {
+
+    public:		// Constructors and destructor
+
+		/**
+		* C++ default constructor.
+		*/
+        CProfileAppUi(
+            CProfileEngineHandler& aEngineHandler,
+            CProfileIndexHandler& aIndexHandler );
+
+        /**
+        * Destructor
+        */
+        ~CProfileAppUi();
+
+		/**
+		* Symbian 2nd phase constructor.
+		*/
+        void ConstructL();
+
+	public:		// Functions from base classes
+
+        /**
+        * From CEikAppUi
+        */
+		void HandleCommandL( TInt aCommand );
+
+	private:	// Data
+
+        // Engine handler
+        CProfileEngineHandler& iEngineHandler;
+
+        // Index handler
+        CProfileIndexHandler& iIndexHandler;
+
+		// Ref: Pointer to Main view
+		CProfileMainView* iMainView;
+
+		// Ref: Pointer to Settings view
+		CProfileSettingsView* iSettingsView;
+	};
+
+#endif // CPROFILEAPPUI_H
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/UIsrc/CProfileApplication.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,35 @@
+/*
+* 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: Application class.
+*
+*/
+
+
+// INCLUDE FILES
+#include "CProfileApplication.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// NewApplication implements...
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CApaApplication* NewApplication()
+    {
+    return new CProfileApplication;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/UIsrc/CProfileApplication.h	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  Application class.
+*
+*/
+
+
+
+#ifndef CPROFILEAPPLICATION_H
+#define CPROFILEAPPLICATION_H
+
+// INCLUDES
+#include <aknapp.h>
+#include "CProfileDocument.h"
+
+// CONSTANTS
+const TUid KUidProfileApp = { 0x100058F8 }; // UID of the application
+
+// CLASS DECLARATION
+/**
+*  Application class.
+*
+*  @lib ProfileApp.app
+*  @since 1.2
+*/
+class CProfileApplication : public CAknApplication
+	{
+	private:	// Functions from base classes
+
+        /**
+        * From CEikApplication
+        */
+		CApaDocument* CreateDocumentL() { return( CProfileDocument::NewL( *this ) ); }
+
+        /**
+        * From CApaApplication
+        */
+		TUid AppDllUid() const { return KUidProfileApp; }
+
+	};
+
+#endif // CPROFILEAPPLICATION_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/UIsrc/CProfileApplication_SEC_APPARC.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  ProfileApplication class for Secure AppArc
+*
+*/
+
+
+// INCLUDE FILES
+#include "CProfileApplication.h"
+#include <eikstart.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// NewApplication
+// -----------------------------------------------------------------------------
+//
+LOCAL_C CApaApplication* NewApplication()
+    {
+    return new CProfileApplication;
+    }
+
+// -----------------------------------------------------------------------------
+// E32Main
+// -----------------------------------------------------------------------------
+//
+GLDEF_C TInt E32Main()
+    {
+    return EikStart::RunApplication( NewApplication );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/UIsrc/CProfileDocument.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,83 @@
+/*
+* 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 document class for Profiles application.
+*
+*/
+
+
+// INCLUDE FILES
+#include "CProfileDocument.h"
+
+#include <featmgr.h>
+#include <CProfileEngineHandler.h>
+#include <CProfileIndexHandler.h>
+
+#include "CProfileAppUi.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileDocument::CProfileDocument
+// C++ constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CProfileDocument::CProfileDocument( CEikApplication& aApp )
+	:	CAknDocument( aApp )
+	{
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileDocument::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfileDocument::ConstructL()
+	{
+	FeatureManager::InitializeLibL();
+    iEngineHandler = CProfileEngineHandler::NewL();
+    iIndexHandler = CProfileIndexHandler::NewL( *iEngineHandler );
+	}
+
+// -----------------------------------------------------------------------------
+// CProfileDocument::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProfileDocument* CProfileDocument::NewL( CEikApplication& aApp )
+	{
+	CProfileDocument* self = new( ELeave ) CProfileDocument( aApp );
+	CleanupStack::PushL( self );
+	self->ConstructL();
+	CleanupStack::Pop( self );
+	return self;
+	}
+
+// Destructor
+CProfileDocument::~CProfileDocument()
+    {
+    delete iIndexHandler;
+	delete iEngineHandler;
+	FeatureManager::UnInitializeLib();
+	}
+
+// -----------------------------------------------------------------------------
+// CProfileDocument::CreateAppUiL
+// -----------------------------------------------------------------------------
+//
+CEikAppUi* CProfileDocument::CreateAppUiL()
+    {
+    return new( ELeave ) CProfileAppUi( *iEngineHandler, *iIndexHandler );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/UIsrc/CProfileDocument.h	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  The document class for Profiles application.
+*
+*/
+
+
+
+#ifndef CPROFILEDOCUMENT_H
+#define CPROFILEDOCUMENT_H
+
+// INCLUDES
+#include <AknDoc.h>
+
+// FORWARD DECLARATIONS
+class CEikAppUi;
+class CProfileEngineHandler;
+class CProfileIndexHandler;
+
+// CLASS DECLARATION
+/**
+*  The document class for Profiles application.
+*  CProfileDocument owns Engine handler and Index handler.
+*  An instance of both are needed during application lifetime.
+*  CProfileDocument initializes the Feature Manager.
+*
+*  @lib ProfileApp.app
+*  @since 1.2
+*/
+NONSHARABLE_CLASS( CProfileDocument ) : public CAknDocument
+    {
+    public:		// Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CProfileDocument* NewL( CEikApplication& aApp );
+
+        /**
+        * Destructor.
+        */
+        ~CProfileDocument();
+
+    private:	// Functions from base classes
+
+       /**
+       * From CEikDocument
+       */
+       CEikAppUi* CreateAppUiL();
+
+	private:
+
+		/**
+        * C++ constructor.
+        */
+        CProfileDocument( CEikApplication& aApp );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+		void ConstructL();
+
+	private:	// Data
+
+        // Own: Engine handler.
+        CProfileEngineHandler* iEngineHandler;
+
+        // Own: Index handler.
+        CProfileIndexHandler* iIndexHandler;
+
+	};
+
+#endif // CPROFILEDOCUMENT_H
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/UIsrc/CProfileMainContainer.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,293 @@
+/*
+* 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: Container class of main view.
+*
+*/
+
+
+// INCLUDE FILES
+
+#include "CProfileMainContainer.h"
+
+#include <AknDef.h>
+#include <aknlists.h>
+#include <AknUtils.h> // AknTextUtils
+#include <featmgr.h>
+#include <CProfileEngineHandler.h>
+#include <CProfileIndexHandler.h>
+#include <MProfileEngineExtended.h>
+#include <MProfilesNamesArray.h>
+#include <csxhelp/mode.hlp.hrh>
+#include <ProfileEng.hrh>
+
+#include "CProfileMainView.h"
+#include "CProfileDocument.h"
+#include "CProfileApplication.h"
+#include "ProfileApp.hrh"
+#include "ProfileEngineConstants.h"
+
+// CONSTANTS
+_LIT( KTabChar, "\t" );
+const TInt KProfileNameArrayGranularity( 5 );
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileMainContainer::CProfileMainContainer
+// C++ constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CProfileMainContainer::CProfileMainContainer(
+    CProfileEngineHandler& aEngineHandler,
+    CProfileIndexHandler& aIndexHandler,
+    CAknView& aView )
+    :   iEngineHandler( aEngineHandler ),
+        iIndexHandler( aIndexHandler ),
+        iView( aView )
+    {
+    SetMopParent( &aView );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileMainContainer::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfileMainContainer::ConstructL( const TRect& aRect )
+    {
+    CreateWindowL();
+
+    iListBox = new( ELeave ) CAknSingleStyleListBox();
+    iListBox->ConstructL( this );
+    iListBox->SetListBoxObserver( this );
+    iListBox->CreateScrollBarFrameL( ETrue );
+    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(
+        CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
+
+    SetRect( aRect );
+    ActivateL();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileMainContainer::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProfileMainContainer* CProfileMainContainer::NewL(
+    CProfileEngineHandler& aEngineHandler,
+    CProfileIndexHandler& aIndexHandler,
+    CAknView& aView )
+    {
+    CProfileMainContainer* self = new( ELeave ) CProfileMainContainer(
+        aEngineHandler, aIndexHandler, aView );
+    CleanupStack::PushL( self );
+    self->ConstructL( aView.ClientRect() );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// Destructor
+CProfileMainContainer::~CProfileMainContainer()
+    {
+    delete iListBox;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileMainContainer::PopulateListBoxL
+// -----------------------------------------------------------------------------
+//
+void CProfileMainContainer::PopulateListBoxL( TInt aTopItemIndex )
+    {
+    // Transfer decorated array ownership for listbox model
+    CDesCArrayFlat* decoratedArray =
+        new( ELeave ) CDesCArrayFlat( KProfileNameArrayGranularity );
+    CTextListBoxModel* model = iListBox->Model();
+    model->SetOwnershipType( ELbmOwnsItemArray );
+    model->SetItemTextArray( decoratedArray );
+
+    MProfilesNamesArray* array = iEngineHandler.IdArray();
+
+    // Populate the decorated array for listbox
+    TInt count( array->MdcaCount() );
+    TBuf<PROFILES_MAX_NAME_LENGTH + 1> name; // + 1 for tab character
+    for( TInt index( 0 ); index < count; index++ )
+        {
+        name.Copy( KTabChar );
+        TBuf< KProfileMaxNameLength > tmpName( array->MdcaPoint( index ) );
+        AknTextUtils::DisplayTextLanguageSpecificNumberConversion( tmpName );
+        AknTextUtils::ReplaceCharacters( tmpName, KAknReplaceListControlChars,
+                                         TChar( ' ' ) );
+        name.Append( tmpName );
+        decoratedArray->AppendL( name );
+        }
+
+    // Update listbox
+    iListBox->HandleItemAdditionL();
+
+    // Update view
+    if( aTopItemIndex >= 0 )
+        {
+        iListBox->SetTopItemIndex( aTopItemIndex );
+        }
+    iListBox->SetCurrentItemIndex( iIndexHandler.CurrentProfileIndex() );
+    iListBox->DrawNow();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileMainContainer::TopItemIndex
+// -----------------------------------------------------------------------------
+//
+TInt CProfileMainContainer::TopItemIndex() const
+    {
+    return iListBox->TopItemIndex();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileMainContainer::CountComponentControls
+// -----------------------------------------------------------------------------
+//
+TInt CProfileMainContainer::CountComponentControls() const
+    {
+    return KMainContainerSubControlCount;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileMainContainer::ComponentControl
+// -----------------------------------------------------------------------------
+//
+CCoeControl* CProfileMainContainer::ComponentControl( TInt aIndex ) const
+    {
+    switch( aIndex )
+        {
+        case 0:
+            {
+            return iListBox;
+            }
+        default:
+            {
+            return NULL;
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileMainContainer::SizeChanged
+// -----------------------------------------------------------------------------
+//
+void CProfileMainContainer::SizeChanged()
+    {
+    if( iListBox )
+        {
+        iListBox->SetRect( Rect() );    // Set container's rect to listbox
+        // Force refreshing of iListBox:
+        TRAP_IGNORE( iListBox->HandleItemAdditionL() );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileMainContainer::OfferKeyEventL
+// -----------------------------------------------------------------------------
+//
+TKeyResponse CProfileMainContainer::OfferKeyEventL(
+    const TKeyEvent& aKeyEvent, TEventCode aType )
+    {
+    if( aType != EEventKey )
+        {
+        return EKeyWasNotConsumed;
+        }
+
+    switch( aKeyEvent.iCode )
+        {
+        case EKeyUpArrow: // flow through, both change focus
+        case EKeyDownArrow:
+            {
+            TKeyResponse response( iListBox->OfferKeyEventL( aKeyEvent, aType ) );
+            iIndexHandler.SetCurrentProfileIndex( iListBox->CurrentItemIndex() );
+            return response;
+            }
+        case EKeyBackspace: // Clear key
+            {
+            if( ( FeatureManager::FeatureSupported( KFeatureIdDynamicProfiles ) ) &&
+                ( !iEngineHandler.Engine()->IsDefaultProfile(
+                    iEngineHandler.IdForIndex( iIndexHandler.CurrentProfileIndex() ) ) ) )
+                {
+                // If dynamic profiles feature is supported and none of
+                // the default profiles is focused, try to delete a profile.
+                iView.HandleCommandL( EProfileCmdDelete );
+                return EKeyWasConsumed;
+                }
+            break;
+            }
+        default:
+            {
+            break;
+            }
+        }
+    return iListBox->OfferKeyEventL( aKeyEvent, aType );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileMainContainer::HandleListBoxEventL
+// -----------------------------------------------------------------------------
+//
+void CProfileMainContainer::HandleListBoxEventL(
+    CEikListBox* /* aListBox */, TListBoxEvent aEventType )
+    {
+    if( ( aEventType == EEventEnterKeyPressed ) ||
+        
+        ( aEventType == EEventItemSingleClicked ) )
+    	{
+    	iIndexHandler.SetCurrentProfileIndex( iListBox->CurrentItemIndex() );
+        iView.HandleCommandL( EProfileCmdContextSpecificOptionsMenu );
+    	}
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileMainContainer::GetHelpContext
+// -----------------------------------------------------------------------------
+//
+void CProfileMainContainer::GetHelpContext( TCoeHelpContext& aContext ) const
+    {
+    aContext.iMajor = KUidProfileApp;
+    aContext.iContext = KMODE_HLP_PROFILES_LIST;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileMainContainer::HandleResourceChange
+// -----------------------------------------------------------------------------
+//
+void CProfileMainContainer::HandleResourceChange( TInt aType )
+    {
+    if ( aType == KEikDynamicLayoutVariantSwitch ||
+         aType == KAknsMessageSkinChange )
+        {
+        (static_cast <CProfileMainView *> (&iView))->UpdateClientRect();
+        }
+        
+    CCoeControl::HandleResourceChange( aType );   
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileMainContainer::FocusChanged
+// -----------------------------------------------------------------------------
+//
+void CProfileMainContainer::FocusChanged( TDrawNow aDrawNow )
+    {
+    if( iListBox )
+        {
+        iListBox->SetFocus( IsFocused(), aDrawNow );
+        }
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/UIsrc/CProfileMainContainer.h	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,162 @@
+/*
+* 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:  Container class of main view.
+*
+*/
+
+
+
+#ifndef CPROFILEMAINCONTAINER_H
+#define CPROFILEMAINCONTAINER_H
+
+// INCLUDES
+#include <coecntrl.h>
+#include <eiklbo.h>
+
+// FORWARD DECLARATIONS
+class CAknView;
+class CAknSingleStyleListBox;
+class CProfileEngineHandler;
+class CProfileIndexHandler;
+
+// CONSTANTS
+const TInt KMainContainerSubControlCount( 1 );
+
+// CLASS DECLARATION
+/**
+*  Container class of main view.
+*
+*  @lib ProfileApp.app
+*  @since 1.2
+*/
+NONSHARABLE_CLASS( CProfileMainContainer ) : public CCoeControl
+							, public MEikListBoxObserver
+	{
+	public:		// Constructors and destructors
+
+		/**
+        * Two-phased constructor.
+        * @param aEngineHandler Engine Handler.
+        * @param aIndexHandler Index Handler.
+        * @param aView Pointer to the main view class.
+        * @return Returns an instance of CProfileMainContainer.
+        */
+		static CProfileMainContainer* NewL(
+            CProfileEngineHandler& aEngineHandler,
+            CProfileIndexHandler& aIndexHandler,
+            CAknView& aView );
+
+		/**
+		* Destructor.
+		*/
+		~CProfileMainContainer();
+
+	public:		// New functions
+
+		/**
+		* Populates listbox with names of profiles.
+		* Separated to own method to enable updating listbox dynamically
+		* (i.e. supports profiles being added or deleted).
+        * @param aTopItemIndex If given, sets list boxes top item index.
+		*/
+		void PopulateListBoxL( TInt aTopItemIndex = KErrNotFound );
+
+		/**
+		* Returns the top item index of the listbox.
+		* Needed to set index back when returning from personalise state.
+        * @return Returns the top item index of the listbox.
+		*/
+		TInt TopItemIndex() const;
+
+	private:	// Functions from base classes
+
+        /**
+        * From CoeControl
+        */
+		TInt CountComponentControls() const;
+
+        /**
+        * From CoeControl
+        */
+		CCoeControl* ComponentControl( TInt aIndex ) const;
+
+        /**
+        * From CoeControl
+        */
+		void SizeChanged();
+
+        /**
+        * From CoeControl
+        */
+		TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
+
+		/**
+        * From CCoeControl
+        */
+        void GetHelpContext( TCoeHelpContext& aContext ) const;
+        
+        /**
+        * From CCoeControl
+        */
+        void HandleResourceChange(TInt aType);
+
+        /**
+         * From CCoeControl
+         */
+        void FocusChanged( TDrawNow aDrawNow );
+
+        /**
+        * From MEikListBoxObserver
+        */
+        void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType );
+
+	private:
+
+        /**
+        * C++ constructor.
+        * @param aEngineHandler Engine Handler.
+        * @param aIndexHandler Index Handler.
+        * @param aView Pointer to the main view class.
+		*/
+		CProfileMainContainer(
+            CProfileEngineHandler& aEngineHandler,
+            CProfileIndexHandler& aIndexHandler,
+            CAknView& aView );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        * @param aRect Drawing area.
+        */
+ 		void ConstructL( const TRect& aRect );
+
+	private:	// Data
+
+        // Engine handler
+        CProfileEngineHandler& iEngineHandler;
+
+        // Index handler
+        CProfileIndexHandler& iIndexHandler;
+
+		// The view class (to call HandleCommandL).
+		CAknView& iView;
+
+		// Own: Listbox class.
+		CAknSingleStyleListBox* iListBox;
+
+	};
+
+#endif // CPROFILEMAINCONTAINER_H
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/UIsrc/CProfileMainView.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,717 @@
+/*
+* 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:  Main view class.
+*
+*/
+
+// INCLUDE FILES
+#include    "CProfileMainView.h"
+
+#include    <aknViewAppUi.h>
+#include    <aknnotewrappers.h>
+#include    <eikmenub.h>
+#include    <featmgr.h>
+#include    <AknQueryDialog.h>
+
+#ifndef RD_STARTUP_CHANGE
+#include	<PSVariables.h>
+#include	<e32property.h>
+#else
+#include 	<startupdomainpskeys.h>
+#endif 
+
+#include    <akntitle.h>
+#include	<StringLoader.h>
+#include    <CProfileChangeNotifyHandler.h>
+#include    <CProfileEngineHandler.h>
+#include    <CProfileIndexHandler.h>
+#include	<MProfileEngine.h>
+#include    <MProfileEngineExtended.h>
+#include    <MProfile.h>
+#include    <MProfileName.h>
+#include    <MProfileExtended.h>
+#include    <MProfilesNamesArray.h>
+#include    <Profile.hrh>
+#include    <profileapp.rsg>
+#include 	<AknQueryDialog.h>
+
+#include    "CProfileMainContainer.h"
+#include    "CProfileDocument.h"
+#include    "ProfileApp.hrh"
+#include    "CProfileNaviPaneContainer.h"
+#include    "MProfilesLocalFeatures.h"
+#include 	"ProfilesVariant.hrh" // KProEngFeatureIdTimedProfiles
+
+
+// CONSTANTS
+namespace
+	{
+	//const TInt KNumberOfVisibleProfilesInMainView( 6 );
+	const TInt KOneMinuteInMicrosecond = 1000000 * 60;
+	const TInt KOneHourInMinute = 60;
+	}
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileMainView::CProfileMainView
+// C++ constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CProfileMainView::CProfileMainView(
+    CProfileEngineHandler& aEngineHandler,
+    CProfileIndexHandler& aIndexHandler )
+    :   iEngineHandler( aEngineHandler ),
+        iIndexHandler( aIndexHandler ),
+	    iTopItemIndex( KErrNotFound )
+	{
+	}
+
+// -----------------------------------------------------------------------------
+// CProfileMainView::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfileMainView::ConstructL()
+    {
+    BaseConstructL( R_PROFILE_MAIN_VIEW );
+
+    CAknTitlePane* titlePane = static_cast< CAknTitlePane* >(
+        StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
+
+    HBufC* titleText = StringLoader::LoadLC( R_PROFILE_TEXT_TITLE );
+    titlePane->SetText( titleText ); // takes ownership
+    CleanupStack::Pop( titleText );
+
+    iNotifier = CProfileChangeNotifyHandler::NewL( this );
+    
+    iLocalFeatures = &( iEngineHandler.Engine()->LocalFeatures() );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileMainView::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProfileMainView* CProfileMainView::NewLC(
+    CProfileEngineHandler& aEngineHandler,
+    CProfileIndexHandler& aIndexHandler )
+    {
+    CProfileMainView* self =
+        new( ELeave ) CProfileMainView( aEngineHandler, aIndexHandler );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// Destructor
+CProfileMainView::~CProfileMainView()
+    {
+    delete iNotifier;
+    delete iNaviPaneContainer;
+    if( iContainer )
+        {
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileMainView::DisplayConfirmationQueryL
+// -----------------------------------------------------------------------------
+//
+TBool CProfileMainView::DisplayConfirmationQueryL( TInt aResourceId ) const
+	{
+	CAknQueryDialog* dlg = CAknQueryDialog::NewL();
+	return dlg->ExecuteLD( aResourceId );
+	}
+
+// -----------------------------------------------------------------------------
+// CProfileMainView::DoCmdActivateL
+// -----------------------------------------------------------------------------
+//
+void CProfileMainView::DoCmdActivateL()
+	{
+	// ID of the currently focused profile
+	// (the profile that user would like to activate)
+	TInt currentProfileId(
+		iEngineHandler.IdForIndex( iIndexHandler.CurrentProfileIndex() ) );
+
+	// If Off-line profile is supported
+	if( ( FeatureManager::FeatureSupported( KFeatureIdOfflineMode ) ) &&
+		// and active profile is Off-line
+		( iEngineHandler.Engine()->ActiveProfileId() == EProfileOffLineId ) &&
+		// and currently focused profile is not Off-line
+		( currentProfileId != EProfileOffLineId ) )
+		{
+		// We are changing from Off-line to a normal profile.
+        // Check if SIM card exists or not
+#ifndef RD_STARTUP_CHANGE         
+        TInt simCStatus( EPSCSimRemoved );
+#else
+	    TInt simCStatus( ESimNotPresent );
+#endif        
+
+		RProperty simStatus;
+#ifndef RD_STARTUP_CHANGE
+		User::LeaveIfError(
+        simStatus.Attach( KUidSystemCategory, KPSUidSimCStatusValue ) );
+    	User::LeaveIfError( simStatus.Get( simCStatus ) );
+#else
+		User::LeaveIfError(
+        simStatus.Attach( KPSUidStartup, KPSSimStatus ) );
+    	User::LeaveIfError( simStatus.Get( simCStatus ) );
+#endif
+    	simStatus.Close();
+
+#ifndef RD_STARTUP_CHANGE 		
+		if( simCStatus == EPSCSimRemoved )
+#else
+		if( simCStatus == ESimNotPresent )
+#endif		
+			{
+			// SIM card does not exist.
+			// Show an information note and exit from method.
+			HBufC* infoText = StringLoader::LoadLC( R_PROFILE_TEXT_INSERT_SIM );
+			CAknInformationNote* note =
+                new( ELeave ) CAknInformationNote( ETrue );
+			note->ExecuteLD( *infoText );
+			CleanupStack::PopAndDestroy( infoText );
+			return;
+			}
+		}
+	iEngineHandler.Engine()->SetActiveProfileL( currentProfileId );
+	}
+
+// -----------------------------------------------------------------------------
+// CProfileMainView::DoCmdCreateNewL
+// -----------------------------------------------------------------------------
+//
+void CProfileMainView::DoCmdCreateNewL()
+	{
+	MProfileExtended* profile = iEngineHandler.Engine()->CreateProfileL(); // CSI: 35 # profile object deleted before leaving function calls
+	if( profile )
+		{
+		// Profile creation successful
+		TInt id( profile->ProfileName().Id() );
+		profile->Release();
+		iEngineHandler.ReadIdArrayL();
+		// Focus the created profile:
+		iIndexHandler.SetCurrentProfileIndex(
+			iEngineHandler.IdArray()->FindById( id ) );
+		AppUi()->HandleCommandL( EProfileCmdPersonalise );
+		}
+	else
+		{
+		// Maximum number of user created profiles reached, show error note
+		HBufC* errorText = StringLoader::LoadLC(
+			R_PROFILE_TEXT_ERROR_MAXIMUM );
+		CAknErrorNote* note = new( ELeave ) CAknErrorNote( ETrue );
+		note->ExecuteLD( *errorText );
+		CleanupStack::PopAndDestroy( errorText );
+		}
+	}
+
+// -----------------------------------------------------------------------------
+// CProfileMainView::DoCmdDeleteL
+// -----------------------------------------------------------------------------
+//
+void CProfileMainView::DoCmdDeleteL()
+	{
+	// Ask user if he/she wants to delete profile
+	if( !DisplayConfirmationQueryL( R_PROFILE_DELETE_CONFIRMATION_QUERY ) )
+		{
+		// User didn't want to delete the profile, return
+		return;
+		}
+
+    TInt currentProfileIndex( iIndexHandler.CurrentProfileIndex() );
+
+	// Try deleting the focused profile
+	TInt errorCode( iEngineHandler.Engine()->DeleteProfileL(
+		iEngineHandler.IdForIndex( currentProfileIndex ) ) );
+
+	if( errorCode == KErrNone )
+		{
+		iEngineHandler.ReadIdArrayL();
+		TInt lastIndex = iEngineHandler.IdArray()->MdcaCount() - 1;
+		if( currentProfileIndex > lastIndex )
+			{
+			// The last profile in the list was deleted. change focus.
+			iIndexHandler.SetCurrentProfileIndex( lastIndex );
+			}
+		iContainer->PopulateListBoxL();
+		}
+	else
+		{
+		// Show error note if cannot delete profile
+		HBufC* errorText = StringLoader::LoadLC(
+            R_PROFILE_TEXT_DELETE_ERROR );
+		CAknErrorNote* note = new( ELeave ) CAknErrorNote( ETrue );
+		note->ExecuteLD( *errorText );
+		CleanupStack::PopAndDestroy( errorText );
+		}
+	}
+
+// -----------------------------------------------------------------------------
+// CProfileMainView::DoCmdContextSpecificOptionsMenuL
+// -----------------------------------------------------------------------------
+//
+void CProfileMainView::DoCmdContextSpecificOptionsMenuL()
+	{
+	// Switch to Context specific options menu,
+	// show it and switch back to main view options menu.
+	CEikMenuBar* menuBar = MenuBar();
+	menuBar->SetMenuType( CEikMenuBar::EMenuContext );
+	menuBar->SetMenuTitleResourceId(
+		R_PROFILE_MAIN_VIEW_CONTEXT_SPECIFIC_OPTIONS_MENUBAR );
+	
+	// TRAP displaying of menu bar.
+	// If it fails, the correct resource is set back before leave.
+	TRAPD( error, menuBar->TryDisplayContextMenuBarL() );
+
+	menuBar->SetMenuType( CEikMenuBar::EMenuOptions );
+	menuBar->SetMenuTitleResourceId( R_PROFILE_MAIN_VIEW_OPTIONS_MENUBAR );
+	User::LeaveIfError( error );
+	
+	}
+
+// -----------------------------------------------------------------------------
+// CProfileMainView::DisplayTimedNote
+// -----------------------------------------------------------------------------
+//	
+void CProfileMainView::DisplayTimedInfoNoteL( TInt aMinutes, TInt aHours ) const
+	{
+	TInt resourceId = R_PROFILE_CONF_SINGULAR;
+	TBool minutesSingular( EFalse );
+	TBool hoursSingular( EFalse );
+		
+	if( aMinutes == 1)
+		{
+		minutesSingular = ETrue;
+		}
+	if( aHours == 1 )	
+		{
+		hoursSingular = ETrue;
+		}
+
+	if( ( !minutesSingular ) && ( hoursSingular ) )
+		{
+		resourceId = R_PROFILE_CONF_HOUR_SEV_MIN;
+		}
+	else if( ( minutesSingular ) && ( !hoursSingular ) )
+		{
+		resourceId = R_PROFILE_CONF_SEV_HOURS_MIN;
+		}
+	else if( ( !minutesSingular ) && ( !hoursSingular ) )
+		{
+		resourceId = R_PROFILE_CONF_PLURAL;
+		}
+	
+	CArrayFix<TInt>* array = new( ELeave ) CArrayFixFlat<TInt>(1);
+    CleanupStack::PushL( array );
+   
+    array->AppendL( aHours );
+    array->AppendL( aMinutes );
+    	
+    HBufC* expiryText = StringLoader::LoadLC(
+    	resourceId, *array );
+        		
+    CAknInformationNote* note = new( ELeave ) CAknInformationNote( EFalse );
+
+    note->ExecuteLD( *expiryText );
+
+	// expiryText
+	CleanupStack::PopAndDestroy( expiryText );
+		
+	// array
+    CleanupStack::PopAndDestroy( array );
+	}
+
+// -----------------------------------------------------------------------------
+// CProfileMainView::DisplayTimedQueryNote
+// -----------------------------------------------------------------------------
+//
+void CProfileMainView::DisplayTimedQueryNoteL( TInt aMinutes, TInt aHours ) const
+	{
+	TInt resourceId = R_PROFILE_CONF_SINGULAR;
+	TBool minutesSingular( EFalse );
+	TBool hoursSingular( EFalse );
+		
+	if( aMinutes == 1)
+		{
+		minutesSingular = ETrue;
+		}
+	if( aHours == 1 )	
+		{
+		hoursSingular = ETrue;
+		}
+
+	if( ( !minutesSingular ) && ( hoursSingular ) )
+		{
+		resourceId = R_PROFILE_CONF_HOUR_SEV_MIN;
+		}
+	else if( ( minutesSingular ) && ( !hoursSingular ) )
+		{
+		resourceId = R_PROFILE_CONF_SEV_HOURS_MIN;
+		}
+	else if( ( !minutesSingular ) && ( !hoursSingular ) )
+		{
+		resourceId = R_PROFILE_CONF_PLURAL;
+		}
+	
+	CArrayFix<TInt>* array = new( ELeave ) CArrayFixFlat<TInt>(1);
+    CleanupStack::PushL( array );
+   
+    array->AppendL( aHours );
+    array->AppendL( aMinutes );
+    	
+    HBufC* expiryText = StringLoader::LoadLC(
+    	resourceId, *array );
+        		
+    CAknQueryDialog* query = CAknQueryDialog::NewL();
+    const TInt ret(
+     query->ExecuteLD( R_PROFILE_CONFIRM_TIMED_QUERY, *expiryText ) );
+
+	// expiryText
+	CleanupStack::PopAndDestroy( expiryText );
+		
+	// array
+    CleanupStack::PopAndDestroy( array );
+	}
+
+// -----------------------------------------------------------------------------
+// CProfileMainView::DoCmdTimedL
+// -----------------------------------------------------------------------------
+//
+void CProfileMainView::DoCmdTimedL()
+	{
+	// ID of the currently focused profile
+	// (the profile that user would like to activate)
+	TInt currentProfileId(
+		iEngineHandler.IdForIndex( iIndexHandler.CurrentProfileIndex() ) );
+
+	// If Off-line profile is supported
+	if( ( FeatureManager::FeatureSupported( KFeatureIdOfflineMode ) ) &&
+		// and active profile is Off-line
+		( iEngineHandler.Engine()->ActiveProfileId() == EProfileOffLineId ) &&
+		// and currently focused profile is not Off-line
+		( currentProfileId != EProfileOffLineId ) )
+		{
+		// We are changing from Off-line to a normal profile.
+        // Check if SIM card exists or not
+#ifndef RD_STARTUP_CHANGE         
+        TInt simCStatus( EPSCSimRemoved );
+#else
+	    TInt simCStatus( ESimNotPresent );
+#endif        
+
+		RProperty simStatus;
+#ifndef RD_STARTUP_CHANGE
+		User::LeaveIfError(
+        simStatus.Attach( KUidSystemCategory, KPSUidSimCStatusValue ) );
+    	User::LeaveIfError( simStatus.Get( simCStatus ) );
+#else
+		User::LeaveIfError(
+        simStatus.Attach( KPSUidStartup, KPSSimStatus ) );
+    	User::LeaveIfError( simStatus.Get( simCStatus ) );
+#endif
+    	simStatus.Close();
+
+#ifndef RD_STARTUP_CHANGE 		
+		if( simCStatus == EPSCSimRemoved )
+#else
+		if( simCStatus == ESimNotPresent )
+#endif		
+			{
+			// SIM card does not exist.
+			// Show an information note and exit from method.
+			HBufC* infoText = StringLoader::LoadLC( R_PROFILE_TEXT_INSERT_SIM );
+			CAknInformationNote* note =
+                new( ELeave ) CAknInformationNote( ETrue );
+			note->ExecuteLD( *infoText );
+			CleanupStack::PopAndDestroy( infoText );
+			return;
+			}
+		}
+
+	TTime expireTime;
+	expireTime.HomeTime();
+	
+	HBufC* expiryTime =
+    	StringLoader::LoadLC( R_PROFILE_SETTING_EXPIRY_TIME );
+    	 		
+	CAknTimeQueryDialog* dlg = new(ELeave) CAknTimeQueryDialog( expireTime );
+    if (dlg->ExecuteLD(R_PROFILE_TIME_QUERY, *expiryTime ))
+    	{
+    	// Timing currently active profile is not allowed. This can happen
+    	// if active profile is changed after the timing process begins.
+    	// Exception: re-timing a timed profile.
+	    MProfileEngine* profileEngine = CreateProfileEngineL();
+	    CleanupReleasePushL( *profileEngine );
+	    TBool isActiveProfileTimed = profileEngine->IsActiveProfileTimedL();
+	    CleanupStack::PopAndDestroy( profileEngine );
+
+    	if( currentProfileId == iEngineHandler.Engine()->ActiveProfileId()
+    		 &&	!isActiveProfileTimed )
+    		{
+			HBufC* errorText = StringLoader::LoadLC(
+	            R_PROFILE_ERROR_TIMING_ACTIVE_PROFILE );
+			CAknErrorNote* note = new( ELeave ) CAknErrorNote( ETrue );
+			note->ExecuteLD( *errorText );
+			CleanupStack::PopAndDestroy( errorText );
+    		return;
+    		}
+    	
+    	TTime originalTime;
+        originalTime.HomeTime();
+
+    	TDateTime expiredtime = expireTime.DateTime();
+        TDateTime originaltdtime = originalTime.DateTime();
+        expiredtime.SetDay(originaltdtime.Day());
+        expiredtime.SetMonth(originaltdtime.Month());
+        expiredtime.SetYear(originaltdtime.Year());
+    	expireTime = expiredtime;
+    	
+    	if( expireTime < originalTime )
+    		{
+    		expireTime += TTimeIntervalDays(1);
+    		}
+		
+		TTimeIntervalMicroSeconds remainTime(
+		 expireTime.MicroSecondsFrom( originalTime ) );
+    	TInt64 tmp = ( remainTime.Int64() ) / KOneMinuteInMicrosecond;
+    	TInt minutes = I64INT(tmp);
+		TInt hours(minutes / KOneHourInMinute);
+    	minutes -= hours * KOneHourInMinute;
+	
+		DisplayTimedQueryNoteL( minutes, hours );
+		
+		MProfileEngineExtended* engine = iEngineHandler.Engine();
+		engine->SetActiveProfileTimedL( currentProfileId, expireTime );
+        }
+	CleanupStack::PopAndDestroy( expiryTime );        
+	}
+
+// -----------------------------------------------------------------------------
+// CProfileMainView::Id
+// -----------------------------------------------------------------------------
+//
+TUid CProfileMainView::Id() const
+    {
+    return KProfileAppMainViewId;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileMainView::HandleCommandL
+// -----------------------------------------------------------------------------
+//
+void CProfileMainView::HandleCommandL( TInt aCommand )
+    {
+    switch ( aCommand )
+        {
+        case EProfileCmdActivate:
+            {
+			DoCmdActivateL();
+            break;
+            }
+		case EProfileCmdCreateNew:
+			{
+			DoCmdCreateNewL();
+			break;
+			}
+		case EProfileCmdDelete:
+			{
+			DoCmdDeleteL();
+			break;
+			}
+        case EProfileCmdContextSpecificOptionsMenu:
+        case EAknSoftkeyContextOptions:
+            {
+			DoCmdContextSpecificOptionsMenuL();
+            break;
+            }
+        case EProfileCmdTimed:
+        	{
+        	DoCmdTimedL();
+        	break;
+        	}
+        default:
+            {
+            AppUi()->HandleCommandL( aCommand );
+            break;
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileMainView::DoActivateL
+// -----------------------------------------------------------------------------
+//
+void CProfileMainView::DoActivateL(
+    const TVwsViewId& /* aPrevViewId */,
+    TUid aCustomMessageId,
+    const TDesC8& /* aCustomMessage */ )
+    {
+    if( !iContainer )
+        {
+        iContainer = CProfileMainContainer::NewL(
+            iEngineHandler, iIndexHandler, *this );
+		iContainer->PopulateListBoxL( iTopItemIndex );
+        iNaviPaneContainer =
+            CProfileNaviPaneContainer::NewL( *StatusPane(), iEngineHandler );
+        // Set the name of the active profile to navi pane
+        iNaviPaneContainer->SetNaviPaneTextL();
+        AppUi()->AddToViewStackL( *this, iContainer );
+        iContainer->MakeVisible( ETrue );
+        }
+
+    if( aCustomMessageId == KProfileAppMainViewId )
+    	{
+		DoCmdCreateNewL(); 
+    	}
+
+    CEikMenuBar* menuBar = MenuBar();
+	menuBar->SetContextMenuTitleResourceId(
+		R_PROFILE_MAIN_VIEW_CONTEXT_SPECIFIC_OPTIONS_MENUBAR );
+		
+		
+    if ( iEikonEnv->StartedAsServerApp() )
+        {
+        UpdateCbaL(R_PROFILE_MAIN_VIEW_CBA_2);    
+        }
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileMainView::DoDeactivate
+// -----------------------------------------------------------------------------
+//
+void CProfileMainView::DoDeactivate()
+    {
+    delete iNaviPaneContainer;
+    iNaviPaneContainer = NULL;
+    if( iContainer )
+        {
+		iTopItemIndex = iContainer->TopItemIndex();
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileMainView::DynInitMenuPaneL
+// -----------------------------------------------------------------------------
+//
+void CProfileMainView::DynInitMenuPaneL(
+    TInt aResourceId, CEikMenuPane* aMenuPane )
+	{
+	if( !iContainer ||
+        ( (aResourceId != R_PROFILE_MAIN_VIEW_OPTIONS_MENUPANE) &&
+          (aResourceId != R_PROFILE_MAIN_VIEW_CONTEXT_SPECIFIC_OPTIONS_MENUPANE)
+            ) )
+        {
+        return;
+        }
+
+    // ID of the currently focused profile
+    TInt currentProfileId(
+        iEngineHandler.IdForIndex( iIndexHandler.CurrentProfileIndex() ) );
+    TInt activeProfileId( iEngineHandler.Engine()->ActiveProfileId() );
+
+    // "Timed" item is in both menus:
+    if( aResourceId == R_PROFILE_MAIN_VIEW_CONTEXT_SPECIFIC_OPTIONS_MENUPANE && (( !iLocalFeatures->IsFeatureSupported( KProEngFeatureIdTimedProfiles ) )
+            || ( currentProfileId == EProfileOffLineId ) ||
+            ( ( activeProfileId == currentProfileId ) && 
+              !iEngineHandler.Engine()->IsActiveProfileTimedL() ) ))
+        {
+        // Timed profiles is not supported. Hide Timed option from
+        // Options menu
+        aMenuPane->SetItemDimmed( EProfileCmdTimed, ETrue );
+        }
+    if(aResourceId == R_PROFILE_MAIN_VIEW_CONTEXT_SPECIFIC_OPTIONS_MENUPANE &&  ( FeatureManager::FeatureSupported(KFeatureIdDynamicProfiles) ) &&
+                  iEngineHandler.Engine()->IsDefaultProfile( currentProfileId ) )
+                {
+                // A default profile is focused. Hide Delete from Options menu
+                aMenuPane->SetItemDimmed( EProfileCmdDelete, ETrue );
+                }
+    
+    if( aResourceId == R_PROFILE_MAIN_VIEW_OPTIONS_MENUPANE )
+        {
+        if( !FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+            {
+            // Help is not supported. Hide Help from Options menu
+            aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue );
+            }
+        // Check that dynamic profiles are supported
+        // before trying to hide Delete from Options menu.
+       /* if( ( FeatureManager::FeatureSupported(KFeatureIdDynamicProfiles) ) &&
+              iEngineHandler.Engine()->IsDefaultProfile( currentProfileId ) )
+            {
+            // A default profile is focused. Hide Delete from Options menu
+            aMenuPane->SetItemDimmed( EProfileCmdDelete, ETrue );
+            }*/
+        }
+
+	}
+
+// -----------------------------------------------------------------------------
+// CProfileMainView::HandleActiveProfileEventL
+// -----------------------------------------------------------------------------
+//
+void CProfileMainView::HandleActiveProfileEventL(
+    TProfileEvent /* aProfileEvent */, TInt /* aProfileId */ )
+    {
+    if( iNaviPaneContainer )
+        {
+        // Active profile has changed. Change active profile name in navi pane.
+        iNaviPaneContainer->SetNaviPaneTextL();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileMainView::UpdateClientRect
+// -----------------------------------------------------------------------------
+//
+void CProfileMainView::UpdateClientRect()
+	{
+	iContainer->SetRect( ClientRect() );
+	}
+
+// -----------------------------------------------------------------------------
+// CProfileMainView::View
+// -----------------------------------------------------------------------------
+//
+CAknView& CProfileMainView::View()
+    {
+    return *this;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfileMainView::UpdateCbaL
+// 
+// -----------------------------------------------------------------------------
+//
+void CProfileMainView::UpdateCbaL(TInt aResourceId)
+    {
+    CEikButtonGroupContainer* cba = Cba();
+    cba->SetCommandSetL(aResourceId);
+    cba->DrawDeferred();
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/UIsrc/CProfileMainView.h	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  Main view class.
+*
+*/
+
+
+
+#ifndef CPROFILEMAINVIEW_H
+#define CPROFILEMAINVIEW_H
+
+// INCLUDES
+#include <aknview.h>
+#include "MProfileChangeObserver.h"
+#include "MProfileViewHandler.h"
+
+// CONSTANTS
+const TUid KProfileAppMainViewId	= { 1 }; // UID of view
+
+// FORWARD DECLARATIONS
+class CProfileEngineHandler;
+class CProfileIndexHandler;
+class CProfileMainContainer;
+class CProfileChangeNotifyHandler;
+class CProfileNaviPaneContainer;
+class MProfilesLocalFeatures;
+
+// CLASS DECLARATION
+/**
+*  Main view class.
+*  Derived from MProfileChangeObserver to get an event when active profile is
+*  changed (needed for updating the navi pane).
+*
+*  @lib ProfileApp.app
+*  @since 1.2
+*/
+NONSHARABLE_CLASS( CProfileMainView ) : public CAknView,
+                         public MProfileChangeObserver,
+                         public MProfileViewHandler
+    {
+    public:     // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        * @param aEngineHandler Engine Handler.
+        * @param aIndexHandler Index Handler.
+        * @return Returns an instance of CProfileMainView.
+        */
+        static CProfileMainView* NewLC(
+            CProfileEngineHandler& aEngineHandler,
+            CProfileIndexHandler& aIndexHandler );
+
+        /**
+        * Destructor.
+        */
+        ~CProfileMainView();
+
+	public:     // Functions from base classes
+
+        /**
+        * From CAknView
+        */
+        TUid Id() const;
+
+        /**
+        * From CAknView
+        */
+        void HandleCommandL( TInt aCommand );
+        
+        /**
+        * From MProfileViewHandler
+        */
+        void UpdateClientRect();
+
+        /**
+        * From MProfileViewHandler
+        */
+		CAknView& View();
+
+    private:    // New functions
+
+		/**
+		* Launches a CAknQueryDialog.
+		* @param aResourceId Resource id to DIALOG resource.
+		* @return Returns ETrue if user accepted the query.
+		*/
+		TBool DisplayConfirmationQueryL( TInt aResourceId ) const;
+
+		/**
+		* HandleCommandL switch separated to own method.
+		*/
+		void DoCmdActivateL();
+
+		/**
+		* HandleCommandL switch separated to own method.
+		*/
+		void DoCmdCreateNewL();
+
+		/**
+		* HandleCommandL switch separated to own method.
+		*/
+		void DoCmdDeleteL();
+
+		/**
+		* HandleCommandL switch separated to own method.
+		*/
+		void DoCmdContextSpecificOptionsMenuL();
+		
+		/**
+		* HandleCommandL switch separated to own method.
+		*/
+		void DoCmdTimedL();
+		
+		/**
+		* Displays information note containing time left
+		* until the profile expires
+		*/
+		void DisplayTimedInfoNoteL( TInt aMinutes, TInt aHours ) const;
+		/**
+		* Displays confirmation note containing time left
+		* until the profile expires
+		*/
+		void DisplayTimedQueryNoteL( TInt aMinutes, TInt aHours ) const;
+		
+		/**
+		* Update cba.
+		*/
+		void UpdateCbaL(TInt aResourceId);
+
+
+    private:    // Functions from base classes.
+
+        /**
+        * From CAknView
+        */
+        void DoActivateL(
+            const TVwsViewId& aPrevViewId,
+            TUid aCustomMessageId,
+            const TDesC8& aCustomMessage );
+
+		/**
+        * From CAknView
+        */
+        void DoDeactivate();
+
+        /**
+        * From CAknView
+        */
+		void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+
+        /**
+        * From MProfileChangeObserver
+        */
+        void HandleActiveProfileEventL(
+            TProfileEvent aProfileEvent, TInt aProfileId );
+
+    private:
+
+        /**
+        * C++ constructor.
+        * @param aEngineHandler Engine Handler.
+        * @param aIndexHandler Index Handler.
+        */
+        CProfileMainView(
+            CProfileEngineHandler& aEngineHandler,
+            CProfileIndexHandler& aIndexHandler );
+
+	    /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+    private:    // Data
+
+        // Engine handler
+        CProfileEngineHandler& iEngineHandler;
+
+        // Index handler
+        CProfileIndexHandler& iIndexHandler;
+
+        // Top item index of the listbox.
+		TInt iTopItemIndex;
+
+        // Own: Main Container.
+        CProfileMainContainer* iContainer;
+
+        // Own: Profile change notify handler.
+        CProfileChangeNotifyHandler* iNotifier;
+
+        // Own: Navi pane container.
+        CProfileNaviPaneContainer* iNaviPaneContainer;
+        
+        // Not own: locally variated features of Profiles:
+        MProfilesLocalFeatures* iLocalFeatures;
+
+    };
+
+
+#endif // CPROFILEMAINVIEW_H
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/UIsrc/CProfileSettingsView.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,375 @@
+/*
+* 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: Settings view class.
+*
+*/
+
+
+// INCLUDE FILES
+#include    "CProfileSettingsView.h"
+
+#include    <aknViewAppUi.h>
+#include    <akntitle.h>
+#include    <akntabgrp.h>
+#include    <featmgr.h>
+#include    <MProfileEngineExtended.h>
+#include    <MProfilesNamesArray.h>
+#include    <CProfileEngineHandler.h>
+#include    <CProfileIndexHandler.h>
+#include    <CProfileTabHandler.h>
+#include    <profileapp.rsg>
+
+#include    "ProfilePanics.h"
+#include    "CProfileSettingsContainer.h"
+#include    "ProfileApp.hrh"
+
+
+
+/******************************************************************************
+ * class CProfileTopControl
+ ******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// CProfileTopControl::NewL()
+// 
+// -----------------------------------------------------------------------------
+//
+CProfileTopControl* CProfileTopControl::NewL( CCoeControl* aFocusControl )
+    {
+    CProfileTopControl* self = new ( ELeave ) CProfileTopControl();
+    self->iFocusControl = aFocusControl;
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfileTopControl::FocusChanged()
+// 
+// -----------------------------------------------------------------------------
+//
+void CProfileTopControl::FocusChanged( TDrawNow aDrawNow )
+    {
+    // Not calling super::FocusChanged is intentional
+    if( iFocusControl )
+        {
+        iFocusControl->SetFocus( IsFocused(), aDrawNow );
+        }
+    }
+
+
+/******************************************************************************
+ * class CProfileDummyHandler
+ ******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// CProfileDummyHandler::CProfileDummyHandler()
+// 
+// -----------------------------------------------------------------------------
+//
+CProfileDummyHandler::CProfileDummyHandler()
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfileDummyHandler::~CProfileDummyHandler()
+// 
+// -----------------------------------------------------------------------------
+//
+CProfileDummyHandler::~CProfileDummyHandler()
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfileDummyHandler::CreateSettingItemL()
+// 
+// This should never be called in Profiles App.
+// -----------------------------------------------------------------------------
+//
+CAknSettingItem* CProfileDummyHandler::CreateSettingItemL( TInt /* aIdentifier */ )
+    {
+    User::Panic( KProfilePanicText, EProfilePanicInvalidSettingItemId );
+    return NULL; // to make compiler happy
+    }
+
+
+// -----------------------------------------------------------------------------
+// CProfileDummyHandler::SetObserver()
+// 
+// -----------------------------------------------------------------------------
+//
+void CProfileDummyHandler::SetObserver(MProfileExternalSettingsObserver& /* aObserver */ )
+   {
+   }
+
+
+// -----------------------------------------------------------------------------
+// CProfileDummyHandler::AllowedToChange()
+// 
+// -----------------------------------------------------------------------------
+//
+TBool CProfileDummyHandler::AllowedToChange( TInt /* aSettingItemId */ ) const
+    {
+    return EFalse;
+    }
+
+
+
+/******************************************************************************
+ * class CProfileSettingsView
+ ******************************************************************************/
+
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsView::CProfileSettingsView
+// C++ constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CProfileSettingsView::CProfileSettingsView(
+    CProfileEngineHandler& aEngineHandler,
+    CProfileIndexHandler& aIndexHandler )
+    :   iEngineHandler( aEngineHandler ),
+        iIndexHandler( aIndexHandler )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsView::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+void CProfileSettingsView::ConstructL()
+    {
+    BaseConstructL( R_PROFILE_SETTINGS_VIEW );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsView::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProfileSettingsView* CProfileSettingsView::NewLC(
+    CProfileEngineHandler& aEngineHandler,
+    CProfileIndexHandler& aIndexHandler )
+    {
+    CProfileSettingsView* self = new( ELeave ) CProfileSettingsView(
+        aEngineHandler, aIndexHandler );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// Destructor.
+CProfileSettingsView::~CProfileSettingsView()
+    {
+    if( iTopControl )
+        {
+        AppUi()->RemoveFromStack( iTopControl );
+        }
+    if( iTabHandler )
+        {
+        AppUi()->RemoveFromStack( iTabHandler->TabGroup() );
+        }
+    if( iContainer )
+        {
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        }
+    delete iContainer;
+    delete iTabHandler;
+    delete iTopControl;
+    delete iDummyHandler;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsView::Id
+// -----------------------------------------------------------------------------
+//
+TUid CProfileSettingsView::Id() const
+    {
+    return KProfileAppSettingViewId;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsView::HandleCommandL
+// -----------------------------------------------------------------------------
+//
+void CProfileSettingsView::HandleCommandL( TInt aCommand )
+    {
+    switch ( aCommand )
+        {
+        case EAknSoftkeyBack:
+            {
+            if( iContainer && iContainer->ItemEdited() )
+                {
+                break;
+                }
+            AppUi()->HandleCommandL( aCommand );
+            break;
+            }
+        case EAknSoftkeyChange: // From context specific options menu
+        case EProfileCmdChange:
+            {
+            if( !iContainer )
+                {
+                break;
+                }
+            iContainer->EditItemL(
+                iContainer->SettingItemArray()->ItemIndexFromVisibleIndex(
+                    iContainer->ListBox()->CurrentItemIndex() ),
+                    ( aCommand == EProfileCmdChange ) );
+            break;
+            }
+        default:
+            {
+            AppUi()->HandleCommandL( aCommand );
+            break;
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsView::DoActivateL
+// -----------------------------------------------------------------------------
+//
+void CProfileSettingsView::DoActivateL(
+    const TVwsViewId& /* aPrevViewId */,
+    TUid aCustomMessageId,
+    const TDesC8& aCustomMessage )
+    {
+    if ( !iContainer )
+        {
+        // If aCustomMessageId is the same as CProfileSettingsView id,
+        // the caller is external. Check if profile id is given and open it.
+        if( aCustomMessageId == KProfileAppSettingViewId )
+		    {
+		    TLex8 lex( aCustomMessage );
+		    TInt value = 0;
+		    lex.Val( value );
+		    TInt err = KErrNone;
+		    MProfilesNamesArray* profileNamesArray = iEngineHandler.Engine()->ProfilesNamesArrayLC();
+		    TInt index = profileNamesArray->FindById(value);
+		    CleanupStack::PopAndDestroy();
+		    TRAP( err, iIndexHandler.SetCurrentProfileIndex( index ) );	
+
+		    CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
+		    CleanupStack::PushL( cba );
+		    cba->SetCommandSetL( R_PROFILE_SETTINGS_VIEW_CBA_IDLE );
+		    CleanupStack::Pop( cba );
+		    cba->DrawDeferred();	
+		    }
+
+        // Get pointer to navi pane
+        CAknNavigationControlContainer* naviPane =
+            static_cast<CAknNavigationControlContainer*>(
+		    StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) );
+        // Get pointer to title pane
+       	CAknTitlePane* titlePane = static_cast< CAknTitlePane* >(
+		    StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
+
+        //iTabHandler = CProfileTabHandler::NewL(
+        //    iEngineHandler, iIndexHandler, *naviPane );
+
+        iDummyHandler = new ( ELeave ) CProfileDummyHandler();
+        iContainer = CProfileSettingsContainer::NewL(
+            *this, iEngineHandler, *iDummyHandler, &iIndexHandler,
+            iTabHandler, titlePane );
+
+        iTopControl = CProfileTopControl::NewL( iContainer );
+  
+  		AppUi()->AddToViewStackL( *this, iContainer );
+   		// Tab group must be added to stack last.
+   		//AppUi()->AddToStackL( *this, iTabHandler->TabGroup() );
+   		// Top control is always on top as it listens to focus changes (which
+   		// will be routed to container to adapt highlight animation to focus)
+   		AppUi()->AddToStackL( *this, iTopControl );
+
+   		iContainer->MakeVisible( ETrue );
+        }
+   }
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsView::DoDeactivate
+// -----------------------------------------------------------------------------
+//
+void CProfileSettingsView::DoDeactivate()
+    {
+    if( iTopControl )
+        {
+        AppUi()->RemoveFromStack( iTopControl );
+        delete iTopControl;
+        iTopControl = NULL;
+        }
+    if( iTabHandler )
+        {
+        AppUi()->RemoveFromStack( iTabHandler->TabGroup() );
+        delete iTabHandler;
+        iTabHandler = NULL;
+        }
+    if ( iContainer )
+        {
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+    delete iDummyHandler;
+    iDummyHandler = NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsView::DynInitMenuPaneL
+// -----------------------------------------------------------------------------
+//
+void CProfileSettingsView::DynInitMenuPaneL(
+    TInt aResourceId, CEikMenuPane* aMenuPane )
+    {
+    if( ( iContainer ) && 
+        ( aResourceId == R_PROFILE_SETTINGS_VIEW_OPTIONS_MENUPANE ) )
+        {
+        // Check if the setting item is allowed to be changed
+        // If not, hide "Change" from Options menu
+        CAknSettingItemArray* array = iContainer->SettingItemArray();
+        if( !iContainer->AllowedToChange(
+            array->At( array->ItemIndexFromVisibleIndex(
+            iContainer->ListBox()->CurrentItemIndex() ) )->Identifier() ) )
+            {
+            aMenuPane->SetItemDimmed( EProfileCmdChange, ETrue );
+            }
+        if( !FeatureManager::FeatureSupported( KFeatureIdHelp ) ) // Help
+            {
+            aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue );
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsView::UpdateClientRect
+// -----------------------------------------------------------------------------
+//
+void CProfileSettingsView::UpdateClientRect()
+	{
+    iContainer->SetRect( ClientRect() );
+	}
+
+// -----------------------------------------------------------------------------
+// CProfileSettingsView::View
+// -----------------------------------------------------------------------------
+//
+CAknView& CProfileSettingsView::View()
+    {
+    return *this;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/UIsrc/CProfileSettingsView.h	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,183 @@
+/*
+* 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:  Settings view class.
+*
+*/
+
+
+
+#ifndef CPROFILESETTINGSVIEW_H
+#define CPROFILESETTINGSVIEW_H
+
+// INCLUDES
+#include <aknview.h>
+#include "MProfileViewHandler.h"
+
+#include "MProfileExternalSettingsHandler.h"
+
+
+
+// CONSTANTS
+const TUid KProfileAppSettingViewId	= { 2 }; // UID of view
+
+// FORWARD DECLARATIONS
+class CProfileEngineHandler;
+class CProfileIndexHandler;
+class CProfileSettingsContainer;
+class CProfileTabHandler;
+class CProfileTopControl;
+class CProfileDummyHandler;
+
+
+// CLASS DECLARATION
+
+
+/**
+* This interceptor control sits on top of the component stack. Its only purpose
+* is to route focus events to CProfileSettingsContaier. Key events are not
+* handled at all, they just fall through this component.
+*/
+NONSHARABLE_CLASS( CProfileTopControl ) : public CCoeControl
+	{
+	public:
+		static CProfileTopControl* NewL( CCoeControl* aFocusControl );
+		void FocusChanged( TDrawNow aDrawNow ); // Overrides CCoeControl::FocusChanged
+
+	private:
+        CCoeControl* iFocusControl;
+	};
+
+
+// This class is a dummy implementation for external settings interface needed
+// by CProfileSettingsContainer.
+NONSHARABLE_CLASS( CProfileDummyHandler ) : public CBase,
+                                            public MProfileExternalSettingsHandler
+	{
+	public:
+        CProfileDummyHandler();
+        virtual ~CProfileDummyHandler();
+        
+    public:
+        // This should never be called in Profiles App
+		CAknSettingItem* CreateSettingItemL( TInt aIdentifier );
+		void SetObserver(MProfileExternalSettingsObserver& aObserver );
+        TBool AllowedToChange( TInt aSettingItemId ) const;
+	};
+
+
+/**
+*  Settings view class.
+*  @lib ProfileApp.app
+*  @since 1.2
+*/
+NONSHARABLE_CLASS( CProfileSettingsView ) : public CAknView,
+							 public MProfileViewHandler
+    {
+    public:		// Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        * @param aEngineHandler Engine Handler.
+        * @param aIndexHandler Index Handler.
+        * @return Returns an instance of CProfileSettingsView.
+        */
+		static CProfileSettingsView* NewLC(
+            CProfileEngineHandler& aEngineHandler,
+            CProfileIndexHandler& aIndexHandler);
+
+		/**
+		* Destructor.
+		*/
+		~CProfileSettingsView();
+
+	public:		// Functions from base classes
+
+        /**
+        * From CAknView
+        */
+	    TUid Id() const;
+
+        /**
+        * From CAknView
+        */
+		void HandleCommandL( TInt aCommand );
+
+        /**
+        * From CAknView
+        */
+        void DoActivateL(
+			const TVwsViewId& aPrevViewId,
+			TUid aCustomMessageId,
+			const TDesC8& aCustomMessage );
+
+        /**
+        * From CAknView
+        */
+        void DoDeactivate();
+
+        /**
+        * From CAknView
+        */
+		void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+
+		/**
+        * From MProfileViewHandler
+        */
+        void UpdateClientRect();
+
+		/**
+        * From MProfileViewHandler
+        */
+        CAknView& View();
+
+	private:	// Constructors and destructors
+
+		/**
+		* C++ constructor.
+        * @param aEngineHandler Engine Handler.
+        * @param aIndexHandler Index Handler.
+		*/
+		CProfileSettingsView(
+            CProfileEngineHandler& aEngineHandler,
+            CProfileIndexHandler& aIndexHandler);
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+		void ConstructL();
+
+	private:	// Data
+
+        // Engine handler
+        CProfileEngineHandler& iEngineHandler;
+
+        // Index handler
+        CProfileIndexHandler& iIndexHandler;
+
+		// Own: Settings container.
+        CProfileSettingsContainer* iContainer;
+
+        // Own: Tab handler.
+        CProfileTabHandler* iTabHandler;
+
+        // Own: Control to route focus event to settings container
+        CProfileTopControl* iTopControl;
+
+        // Own: Dummy external settings handler for settings container
+        CProfileDummyHandler* iDummyHandler;
+    };
+
+#endif // CPROFILESETTINGSVIEW_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/UIsrc/MProfileRectUpdater.h	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  Interface for getting client rect area.
+*
+*/
+
+
+
+#ifndef MPROFILERECTUPDATER_H
+#define MPROFILERECTUPDATER_H
+
+//  INCLUDES
+#include <e32std.h>
+
+// CLASS DECLARATION
+
+/**
+*  Interface for updating the active area.
+*
+*  @lib ProfileApp.app
+*  @since 2.8
+*/
+class MProfileRectUpdater
+    {
+
+    public: // New functions
+
+        /**
+        * Updates the client drawing area.
+        * @since 2.8
+        */
+		virtual void UpdateClientRect() = 0;
+
+    };
+
+#endif      // MProfileRectUpdater_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/UIsrc/ProfileApp.hrh	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,38 @@
+/*
+* 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:  Resource headers of Profiles application.
+*
+*/
+
+
+
+#ifndef PROFILEAPP_HRH
+#define PROFILEAPP_HRH
+
+// DATA TYPES
+enum TProfileMenuCommandIds
+    {
+    EProfileCmdActivate = 0x6000,
+    EProfileCmdPersonalise,
+    EProfileCmdCreateNew,
+    EProfileCmdDelete,
+    EProfileCmdContextSpecificOptionsMenu,
+    EProfileCmdChange,
+    EProfileCmdTimed
+    };
+
+#endif // PROFILEAPP_HRH
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/UIsrc/ProfileApp.rss	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,477 @@
+/*
+* 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 Application resources
+*
+*/
+
+
+
+//  RESOURCE IDENTIFIER
+NAME    PROF
+
+//  INCLUDES
+#include <eikon.rh>
+#include <avkon.rh>
+#include <avkon.rsg>
+#include <avkon.loc>
+#include <avkon.mbg>
+#include <e32keys.h>
+#include <bldvariant.hrh>
+#include <appinfo.rh>
+#include <ProfileEng.hrh>
+#include <Profile.hrh>
+#include <profileapp.loc>
+#include <Profile.loc>
+#include "ProfileApp.hrh"
+#include <data_caging_paths_strings.hrh>
+
+//  RESOURCE DEFINITIONS
+
+RESOURCE RSS_SIGNATURE {}
+
+RESOURCE TBUF { buf = ""; }
+
+RESOURCE EIK_APP_INFO {}
+
+RESOURCE LOCALISABLE_APP_INFO r_profile_localisable_app_info
+    {
+    short_caption = qtn_apps_mode_grid;
+    caption_and_icon =
+        CAPTION_AND_ICON_INFO
+            {
+            caption = qtn_apps_mode_list;
+
+#ifdef __SCALABLE_ICONS
+
+            number_of_icons = 1;
+            icon_file = APP_BITMAP_DIR"\\ProfileApp_aif.mif";
+
+#else
+
+            number_of_icons = 2;
+            icon_file = APP_BITMAP_DIR"\\ProfileApp_aif.mbm";
+
+#endif // __SCALABLE_ICONS
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_main_view
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_profile_main_view
+    {
+    menubar = r_profile_main_view_options_menubar;
+    cba = r_profile_main_view_cba;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_settings_view
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_profile_settings_view
+    {
+    menubar = r_profile_settings_view_options_menubar;
+    cba = r_profile_settings_view_cba;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_main_view_options_menubar
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_profile_main_view_options_menubar
+    {
+    titles =
+        {
+        MENU_TITLE { menu_pane = r_profile_main_view_options_menupane; }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_main_view_context_specific_options_menubar
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_profile_main_view_context_specific_options_menubar
+    {
+    titles =
+        {
+        MENU_TITLE { menu_pane = r_profile_main_view_context_specific_options_menupane; }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_settings_view_options_menubar
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_profile_settings_view_options_menubar
+    {
+    titles =
+        {
+        MENU_TITLE { menu_pane = r_profile_settings_view_options_menupane; }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_main_view_cba
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_profile_main_view_cba
+    {
+    flags = 0;
+    buttons =
+        {
+        CBA_BUTTON {id=EAknSoftkeyOptions; txt=text_softkey_option;},
+        CBA_BUTTON {id=EAknSoftkeyExit; txt=text_softkey_exit;},
+        CBA_BUTTON {id=EAknSoftkeyContextOptions; txt=text_softkey_option;}
+        };
+    }
+
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_main_view_cba_2
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_profile_main_view_cba_2
+    {
+    flags = 0;
+    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_profile_settings_view_cba
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_profile_settings_view_cba
+    {
+    flags = 0;
+    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_profile_settings_view_cba_idle
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE CBA r_profile_settings_view_cba_idle
+    {
+    flags = 0;
+    buttons =
+        {
+        CBA_BUTTON {id=EAknSoftkeyOptions; txt=text_softkey_option;},
+        CBA_BUTTON {id=EAknSoftkeyExit; txt=text_softkey_exit;},
+        CBA_BUTTON {id=EAknSoftkeyChange; txt=qtn_msk_change;}
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_main_view_options_menupane
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_profile_main_view_options_menupane
+    {
+    items =
+        {
+       // MENU_ITEM { command = EProfileCmdActivate; txt = qtn_mode_activate; },
+        //MENU_ITEM { command = EProfileCmdPersonalise; txt = qtn_mode_personalise; },
+   		//MENU_ITEM { command = EProfileCmdTimed; txt = qtn_profiles_options_timed; },
+#ifdef __DYNAMIC_PROFILES
+        MENU_ITEM { command = EProfileCmdCreateNew; txt = qtn_profiles_options_create_new; },
+       // MENU_ITEM { command = EProfileCmdDelete; txt = qtn_profiles_options_delete; },
+#endif // __DYNAMIC_PROFILES
+        MENU_ITEM { command = EAknCmdHelp; txt = qtn_options_help; },
+        //MENU_ITEM { command = EEikCmdExit; txt = qtn_options_exit; }
+        MENU_ITEM { command = EAknCmdExit; txt = qtn_options_exit; }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_main_view_context_specific_options_menupane
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_profile_main_view_context_specific_options_menupane
+    {
+    items =
+        {
+        MENU_ITEM { command = EProfileCmdActivate; txt = qtn_mode_activate; },
+        MENU_ITEM { command = EProfileCmdPersonalise; txt = qtn_mode_personalise; },
+        MENU_ITEM { command = EProfileCmdDelete; txt = qtn_profiles_options_delete; },
+   		MENU_ITEM { command = EProfileCmdTimed; txt = qtn_profiles_options_timed; }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_settings_view_options_menupane
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_profile_settings_view_options_menupane
+    {
+    items =
+        {
+        //MENU_ITEM { command = EProfileCmdChange; txt = qtn_mode_change; },
+        MENU_ITEM { command = EAknCmdHelp; txt = qtn_options_help; },
+        //MENU_ITEM { command = EEikCmdExit; txt = qtn_options_exit; }
+        MENU_ITEM { command = EAknCmdExit; txt = qtn_options_exit; }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_leave_offline_confirmation_query
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_profile_leave_offline_confirmation_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_YES_NO;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control = AVKON_CONFIRMATION_QUERY
+                {
+                layout = EConfirmationQueryLayout;
+                label = qtn_leave_offline_mode_query;
+                };
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_delete_confirmation_query
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_profile_delete_confirmation_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_YES_NO;
+    items=
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control = AVKON_CONFIRMATION_QUERY
+                {
+                layout = EConfirmationQueryLayout;
+                label = qtn_profiles_conf_delete;
+                };
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_text_title
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_profile_text_title { buf = qtn_mode_profiles; }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_text_insert_sim
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_profile_text_insert_sim { buf = qtn_su_note_insert_sim; }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_text_error_maximum
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_profile_text_error_maximum { buf = qtn_profiles_error_maximum; }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_text_delete_error
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_profile_text_delete_error { buf = qtn_profiles_delete_error; }
+
+// ---------------------------------------------------------
+//
+// r_profile_time_query
+// ?description
+//
+// ---------------------------------------------------------
+//
+RESOURCE DIALOG r_profile_time_query
+    {
+    flags=EGeneralQueryFlags;
+    buttons=R_AVKON_SOFTKEYS_OK_CANCEL;
+    items=
+        {
+        DLG_LINE
+            {
+            type=EAknCtQuery;
+            id=EGeneralQuery;
+            control = AVKON_DATA_QUERY
+                {
+                layout = ETimeLayout;
+                label = text_popupfield_prompt_for_time;
+                control = TIME_EDITOR
+                    {
+                    minTime= TIME {second=0;minute=0;hour=0;};
+                    maxTime= TIME {second=59;minute=59;hour=23;};
+                    flags=EEikTimeWithoutSecondsField;
+                    };
+                };
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_setting_expiry_time
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_profile_setting_expiry_time { buf = qtn_profiles_setting_expiry_time; }    
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_conf_singular
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_profile_conf_singular { buf = qtn_profiles_conf_singular; } 
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_conf_plural
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_profile_conf_plural { buf = qtn_profiles_conf_plural; } 
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_conf_hour_sev_min
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_profile_conf_hour_sev_min { buf = qtn_profiles_conf_hour_sev_min; } 
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_conf_sev_hours_min
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_profile_conf_sev_hours_min { buf = qtn_profiles_conf_sev_hours_min; } 
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_error_timing_active_profile
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_profile_error_timing_active_profile { buf = qtn_profiles_error_timing_active_profile; } 
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_confirm_timed_query
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_profile_confirm_timed_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_EMPTY;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control = AVKON_CONFIRMATION_QUERY
+                {
+                layout = EConfirmationQueryLayout;
+                label = "";
+                bmpfile = AVKON_BITMAP_FILE;
+                bmpid = EMbmAvkonQgn_note_info;
+                bmpmask = EMbmAvkonQgn_note_info_mask;
+                };
+            }
+        };
+    } 
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/group/ProfileApp.lnt	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,33 @@
+/** Unused Enum scan
+-e???? +e749
+*/
+
+/** Unused header scan
+-e???? +e766
+*/
+
+/** standard lint check
+*/
+-w1 -e322
+
+/** define unicode
+-D_UNICODE
+*/
+
+/** Standard include directories */
+
+-i..\aif
+-i..\doc
+-i..\group
+-i..\help
+-i..\uisrc
+-i..\settingsviewinc
+-i..\settingsviewsrc
+-i..\..\ProfileEngine\EngInc
+-i\epoc32\include
+-i\epoc32\include\oem
+
+/** Examined application source directories */
+..\uisrc\*.cpp
+..\settingsviewsrc\*.cpp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/group/ProfileApp.mmp	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  Project definition file for Profiles application
+*
+*/
+
+
+// To get the APP_LAYER_SYSTEMINCLUDE-definition
+#include <platform_paths.hrh>
+#include <data_caging_paths.hrh>
+
+TARGET        profileapp.exe
+EPOCSTACKSIZE   0x5000
+EPOCHEAPSIZE    0x20000 0x400000 // Min 128kb, max 4Mb
+TARGETTYPE    exe
+
+UID             0x100039CE 0x100058F8
+CAPABILITY      CAP_APPLICATION
+VENDORID 	VID_DEFAULT
+
+SOURCEPATH      ../UIsrc
+
+SOURCE          CProfileApplication_SEC_APPARC.cpp
+SOURCE          CProfileAppUi.cpp
+SOURCE          CProfileDocument.cpp
+SOURCE          CProfileMainView.cpp
+SOURCE          CProfileMainContainer.cpp
+SOURCE          CProfileSettingsView.cpp
+
+SYSTEMINCLUDE   ../SettingsViewInc ../SettingsViewSrc
+
+START RESOURCE ProfileApp.rss
+HEADER
+TARGETPATH      APP_RESOURCE_DIR
+LANGUAGE_IDS
+END // RESOURCE
+
+SOURCEPATH      .
+START RESOURCE  ProfileApp_reg.rss
+DEPENDS profileapp.rsg
+ // Do not change the UID
+ TARGETPATH      /private/10003a3f/apps
+END // RESOURCE
+
+USERINCLUDE     . ../UIsrc
+SYSTEMINCLUDE	../../../inc
+
+APP_LAYER_SYSTEMINCLUDE
+
+LIBRARY         euser.lib bafl.lib
+LIBRARY         apparc.lib cone.lib eikcore.lib eikcoctl.lib avkon.lib eikctl.lib
+LIBRARY         featmgr.lib // Feature Manager
+LIBRARY         profileeng.lib // Profile Engine
+LIBRARY         hlplch.lib // Help
+LIBRARY         profilesettingsview.lib // Profiles application settings view
+LIBRARY         commonengine.lib // StringLoader
+
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/group/ProfileAppExports.inc	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,30 @@
+/*
+* ==============================================================================
+*  Name        : ProfileAppExports.inc
+*  Part of     : ProfileApp
+*  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 PROFILEAPPEXPORTS_INC
+#define PROFILEAPPEXPORTS_INC
+
+../loc/ProfileApp.loc    APP_LAYER_LOC_EXPORT_PATH(profileapp.loc)
+
+#endif      // PROFILEAPPEXPORTS_INC
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/group/ProfileApp_reg.rss	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,33 @@
+/*
+* 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: This file contains the application registration resource.
+*
+*/
+
+
+#include <appinfo.rh>
+#include <profileapp.rsg>
+#include <data_caging_paths_strings.hrh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x100058F8
+
+RESOURCE APP_REGISTRATION_INFO
+    {
+    app_file = "ProfileApp";
+    localisable_resource_file = APP_RESOURCE_DIR"\\ProfileApp";
+    localisable_resource_id = R_PROFILE_LOCALISABLE_APP_INFO;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/group/ProfileSettingsView.mmp	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  Project definition file for Profile Settings View
+*
+*/
+
+// To get the APP_LAYER_SYSTEMINCLUDE-definition
+#include <platform_paths.hrh>
+#include <data_caging_paths.hrh>
+
+TARGET          profilesettingsview.dll
+TARGETTYPE      dll
+UID             0x1000008d 0x100058F8
+
+CAPABILITY      CAP_GENERAL_DLL
+VENDORID 	VID_DEFAULT
+
+SOURCEPATH      ../SettingsViewSrc
+SOURCE          CProfileEngineHandler.cpp
+SOURCE          CProfileIndexHandler.cpp
+SOURCE          CProfileTabHandler.cpp
+SOURCE          CProfileSettingsContainer.cpp
+SOURCE          CProfile3dSettingItem.cpp
+SOURCE          CProfile3dSettingPage.cpp
+SOURCE          CProfilePlayingVolumeSettingItem.cpp
+SOURCE          CProfilePlayingVolumeSettingPage.cpp
+SOURCE          CProfileKeypadVolumeSettingPage.cpp
+SOURCE          CProfileNameSettingItem.cpp
+SOURCE          CProfileKeypadVolumeSettingItem.cpp
+SOURCE          CProfileNameSettingPage.cpp
+SOURCE          CProfileFileListSettingItem.cpp
+SOURCE          CProfileAlertForSettingItem.cpp
+SOURCE          CProfileAlertForSettingPage.cpp
+SOURCE          CProfileStruct.cpp
+SOURCE			CProfileToneHandler.cpp
+SOURCE			ProfileMmfInfoUtility.cpp
+
+SOURCE          CProfileStructDrmFull.cpp
+SOURCE			CProfileToneHandlerDrmFull.cpp
+LIBRARY         drmhelper.lib
+SOURCE          CProfileNaviPaneContainer.cpp
+SOURCE          CProfileFeedbackSettingItem.cpp
+SOURCE          CProfileFeedbackSettingPage.cpp
+SOURCE          CProfileVibraSettingItem.cpp
+SOURCE          CProfileVibraSettingPage.cpp
+
+START RESOURCE  ProfileSettingsView.rss
+  HEADER
+  TARGETPATH    RESOURCE_FILES_DIR
+  LANGUAGE_IDS
+END
+
+USERINCLUDE     ../SettingsViewInc ../../Group ../UIsrc
+SYSTEMINCLUDE	../../../inc
+
+APP_LAYER_SYSTEMINCLUDE
+
+LIBRARY         euser.lib efsrv.lib
+LIBRARY         eikcore.lib eikcoctl.lib cone.lib avkon.lib apgrfx.lib
+LIBRARY			bafl.lib // BaflUtils
+LIBRARY			apmime.lib // TDataType
+LIBRARY         cntmodel.lib // Contact database
+LIBRARY         pbkeng.lib // Phone Book contact engine
+LIBRARY         commonengine.lib // Shared data
+LIBRARY         featdiscovery.lib // CFeatureDiscovery
+LIBRARY         featmgr.lib // Feature Manager
+LIBRARY         sssettings.lib // Phone settings (Alternate Line Service)
+LIBRARY         mediaclientaudio.lib // MultiMedia Framework, audio client
+LIBRARY         profileeng.lib // Profile Engine
+LIBRARY         filelist.lib // File List
+LIBRARY         mediafilelist.lib //Media File List
+LIBRARY         ecom.lib
+LIBRARY			centralrepository.lib
+LIBRARY 		cenrepnotifhandler.lib
+LIBRARY			mmfcontrollerframework.lib	// CMMFFormatSelectionParameters
+
+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
+
+DEBUGLIBRARY flogger.lib
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/group/ProjLint.bat	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  batch files
+rem
+
+c:\tools\LINT-NT.EXE +v -ic:\tools\PCLint\APPS\LINT\ std.lnt -os(_lint.tmp) ProfileApp.lnt
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/group/bld.inf	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,45 @@
+/*
+* 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 ProfilesApp
+*
+*/
+
+// To get the APP_LAYER_LOC_EXPORT_PATH-definition
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+    DEFAULT
+
+PRJ_EXPORTS
+#include "ProfileAppExports.inc"
+
+PRJ_EXTENSIONS
+START EXTENSION s60/mifconv
+  OPTION TARGETFILE profileapp_aif.mif
+  OPTION SOURCES -c8,8 qgn_menu_mode
+END
+
+
+PRJ_MMPFILES
+/*
+#ifdef __SCALABLE_ICONS
+	gnumakefile icons_aif_scalable_dc.mk
+#else
+	gnumakefile icons_aif_bitmaps_dc.mk
+#endif // __SCALABLE_ICONS
+*/
+ProfileSettingsView.mmp
+ProfileApp.mmp
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/group/icons_aif_bitmaps_dc.mk	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,68 @@
+#
+# 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: Icons makefile for project ProfileApp.
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+# : Configure these
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)\resource\apps
+ICONTARGETFILENAME=$(TARGETDIR)\profileapp_aif.mbm
+
+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) \
+		/c8,8 qgn_menu_mode_lst.bmp \
+		/c8,8 qgn_menu_mode_cxt.bmp
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/group/icons_aif_scalable_dc.mk	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,67 @@
+#
+# 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:  Icons makefile for project ProfileApp.
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z
+else
+ZDIR=\epoc32\data\z
+endif
+
+# ----------------------------------------------------------------------------
+# : Configure these
+# ----------------------------------------------------------------------------
+
+TARGETDIR=$(ZDIR)\resource\apps
+ICONTARGETFILENAME=$(TARGETDIR)\profileapp_aif.mif
+
+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) \
+		/c8,8 qgn_menu_mode.svg
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/loc/ProfileApp.loc	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,471 @@
+/*
+* 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 application localisation strings.
+*
+*/
+
+
+
+// LOCALISATION STRINGS
+
+//d: Application title (app grid view)
+//l: cell_app_pane_t1
+#define qtn_apps_mode_grid          "Profiles"
+
+//d: Application title (app list view)
+//l: list_single_large_graphic_pane_t1
+#define qtn_apps_mode_list          "Profiles"
+
+//d: Profile Title Pane text (in Profile Main dialog)
+//l: title_pane_t2/opt9
+#define qtn_mode_profiles           "Profiles"
+
+//d: Profile settings list item for ringing tone selection
+//l: list_setting_pane_t1
+#define qtn_mode_ringing_tone       "Ringing tone"
+
+//d: Profile settings list item for line 1 ringing tone selection
+//l: list_setting_pane_t1
+#define qtn_mode_line1_tone         "Line 1 ringing tone"
+
+//d: Profile settings list item for line 2 ringing tone selection
+//l: list_setting_pane_t1
+#define qtn_mode_line2_tone         "Line 2 ringing tone"
+
+//d: Profile settings list item for Video telephone tone selection
+//d: Added to 2.common wk 30.
+//l: list_setting_pane_t1
+#define qtn_mode_vt_tone "Video Call tone"
+
+// d:Error note shown when a tone can't be set
+// d:because tone maximum file size is exceeded.
+// l:popup_note_window
+// r:3.1
+#define qtn_profiles_tone_maxsize_error "Unable to use tone. File size exceeds %N kB."
+
+//d: Profile settings list item for ringing type
+//l: list_setting_pane_t1
+#define qtn_mode_ringing_type_2     "Ringing type"
+
+//d: Profile settings list item for ringing volume
+//l: list_setting_pane_t1
+#define qtn_mode_ringing_volume     "Ringing volume"
+
+//d: Profile settings list item for Media volume
+//l: list_setting_pane_t1
+#define qtn_profiles_media_volume "Media volume"
+
+//d: Profile settings list item for message alert tone
+//l: list_setting_pane_t1
+#define qtn_mode_message_tone       "Message alert tone"
+
+//d: Profile settings list item for vibrating alert
+//l: list_setting_pane_t1
+#define qtn_mode_vibrating_alert    "Vibrating alert"
+
+//d: Profile settings list item for email vibrating alert
+//l: list_setting_pane_t1
+#define qtn_profiles_email_vibra    "Email Vibrating alert"
+
+//d: Profile settings list item for keypad tones
+//l: list_setting_pane_t1
+#define qtn_mode_keypad_volume      "Keypad tones"
+
+//d: Profile settings list item for warning and game tones
+//l: list_setting_pane_t1
+#define qtn_mode_warning_game       "Warning and game tones"
+
+//d: Profile settings list item alert for setting
+//l: list_setting_pane_t1
+#define qtn_mode_alert_for          "Alert for"
+
+//d: Profile settings list item for profile name
+//l: list_setting_pane_t1
+#define qtn_mode_sett_profile_name  "Profile name"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+#define qtn_tc_ringing              "Ringing"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+#define qtn_tc_ascending            "Ascending"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+#define qtn_tc_ring_once            "Ring once"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+#define qtn_tc_beep_once            "Beep once"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+#define qtn_tc_silent               "Silent"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+//r:2.8
+#define qtn_mode_warning_game_on	"On"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+//r:2.8
+#define qtn_mode_warning_game_off	"Off"
+
+// LOC STRINGS FOR KEYPAD VOLUME
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+//r:3.0
+#define qtn_tc_keypad_off			"Off"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+#define qtn_tc_keypad_quiet         "Level 1"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+#define qtn_tc_keypad_medium        "Level 2"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+#define qtn_tc_keypad_loud          "Level 3"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+#define qtn_tc_all_callers          "All callers"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+#define qtn_tc_several_groups       "Several groups"
+
+//d: Message alert tone "None"
+//l: list_single_graphic_pane_t1_cp2
+#define qtn_tc_none                 "None"
+
+//d: Profile Name Existing Notification Message
+//l: popup_note_window
+#define qtn_mode_rename_error       "A profile with that name already exists"
+
+//d: Max Volume Level Notification Message
+//l: popup_note_window
+#define qtn_tc_ringing_level_warning "Select maximum volume for ringing tone?"
+
+//d: Options Menu
+//l: list_single_pane_t1_cp2
+#define qtn_mode_change             "Change"
+
+//d: Options Menu
+//l: list_single_pane_t1_cp2
+#define qtn_mode_activate           "Activate"
+
+//d: Options Menu
+//l: list_single_pane_t1_cp2
+#define qtn_mode_personalise        "Personalise"
+
+//d: File list dialog header
+//l: heading_pane_t1
+#define qtn_tc_popup_heading        "Select tone: "
+
+// LOC STRINGS FOR DYNAMIC PROFILES
+
+//d: Options menu item for creating a new profile
+//l: list_single_pane_t1_cp2
+#define qtn_profiles_options_create_new "Create new profile"
+
+//d: Options menu item for deleting a user created profile
+//l: list_single_pane_t1_cp2
+#define qtn_profiles_options_delete "Delete a profile"
+
+//d: Error note when user tries to delete currently active (selected) profile.
+//l: popup_note_window
+#define qtn_profiles_delete_error "Profile in use, cannot delete"
+
+//d: Error note when user has created maximum number of user created profiles
+//d: and tries to create one more.
+//l: popup_note_window
+#define qtn_profiles_error_maximum "Maximum number of profiles exceeded"
+
+//d: Confirmation query for deleting a user created profile
+//l: popup_note_window
+#define qtn_profiles_conf_delete "Delete profile?"
+
+// LOC STRINGS FOR TIMED PROFILE
+
+//d: Options menu item for timed profile feature
+//l: list_single_pane_t1_cp2
+#define qtn_profiles_options_timed "Timed"
+
+//d: A query window where user enters the time when the profile expires
+//l: popup_query_data_window
+#define qtn_profiles_setting_expiry_time "Profile expires"
+
+//d: Information note which shows how much time is left until profile expires
+//d: 1 hour, 1 minute
+//l: popup_note_window
+#define qtn_profiles_conf_singular "Time left until profile expires:\n%0N hour and %1N minute"
+
+//d: Information note which shows how much time is left until profile expires
+//d: N hours, N minutes
+//l: popup_note_window
+#define qtn_profiles_conf_plural "Time left until profile expires:\n%0N hours and %1N minutes"
+
+//d: Information note which shows how much time is left until profile expires
+//d: 1 hour, N minutes
+//l: popup_note_window
+#define qtn_profiles_conf_hour_sev_min "Time left until profile expires:\n%0N hour and %1N minutes"
+
+//d: Information note which shows how much time is left until profile expires
+//d: N hours, 1 minute
+//l: popup_note_window
+#define qtn_profiles_conf_sev_hours_min "Time left until profile expires:\n%0N hours and %1N minute"
+
+//d: Error note shown if active profile is being timed
+//l: popup_note_window
+//w:
+//r:3.2
+#define qtn_profiles_error_timing_active_profile "Timing currently active profile is not allowed."
+
+
+// LOC STRING FOR E-MAIL ALERT TONE
+
+//d: Profile settings list item for e-mail alert tone
+//l: list_setting_pane_t1
+#define qtn_profiles_e_mail_tone "E-Mail alert tone"
+
+// LOC STRINGS FOR TTS RINGINGTONE
+
+//d: Profile Settings list item for Text-to-Speech ringingtone
+//l: list_setting_pane_t1
+//w:
+//r:3.0
+#define qtn_mode_tts_ringing_tone "Say caller’s name"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+//w:
+//r:3.0
+#define qtn_mode_tts_ringing_tone_on "On"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+//w:
+//r:3.0
+#define qtn_mode_tts_ringing_tone_off "Off"
+
+// LOC STRINGS FOR VIBRA SETTING
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+//r:3.0
+#define qtn_mode_vibrating_alert_on	"On"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+//r:3.0
+#define qtn_mode_vibrating_alert_off	"Off"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+//r:3.0
+#define qtn_mode_email_vibra_on	  "On"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+//r:3.0
+#define qtn_mode_email_vibra_off   "Off"
+
+// LOC STRINGS FOR POC SETTING
+
+//d: Profile settings list item for PTT ringing tone selection
+//l: list_setting_pane_t1
+//w:
+//r:3.1
+#define qtn_poc_profile_ringing_tone       "PTT ringing tone"
+
+//d: Profile settings list item for PTT status
+//l: list_setting_pane_t1
+//w:
+//r:3.1
+#define qtn_poc_profile_status "PTT status"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+//w:
+//r:3.1
+#define qtn_poc_profile_status_active            "Active"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+//w:
+//r:3.1
+#define qtn_poc_profile_status_silent            "Silent"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+//w:
+//r:3.1
+#define qtn_poc_profile_status_dnd            "Do not Disturb"
+
+// LOC STRINGS FOR AUDIO FILE EXISTENCE CHECK
+
+//d: Tone file not found Confirmation Note text
+//d: %U name of the file
+//l: popup_note_window
+//r:3.1
+#define qtn_profiles_confirm_ringtone_found  "%U file cannot be found. Default tone is used instead."
+
+// LOC STRINGS FOR 3D RINGINGTONE
+
+//d: Profile settings list item for 3d effect
+//l: list_setting_pane_t1
+//r:5.0
+#define qtn_profiles_tone_3d_effect  "Ringing 3-D effect"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+//r:5.0
+#define qtn_profiles_3d_effect_off "Off"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+//r:5.0
+#define qtn_profiles_3d_effect_circle "Circle"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+//r:5.0
+#define qtn_profiles_3d_effect_flyby "Flyby"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+//r:5.0
+#define qtn_profiles_3d_effect_zig_zag "Zig-Zag"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+//r:5.0
+#define qtn_profiles_3d_effect_random_walk "Random walk"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+//r:5.0
+#define qtn_profiles_3d_effect_chaos "Chaos"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+//r:5.0
+#define qtn_profiles_3d_effect_stereo_widening "Stereo widening"
+
+//d: Profile settings list item for 3d echo
+//l: list_setting_pane_t1
+//r:5.0
+#define qtn_profiles_tone_3d_echo "Ringing 3-D echo"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+//r:5.0
+#define qtn_profiles_3d_echo_off "Off"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+//r:5.0
+#define qtn_profiles_3d_echo_living_room "Living room"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+//r:5.0
+#define qtn_profiles_3d_echo_cave "Cave"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+//r:5.0
+#define qtn_profiles_3d_echo_stone_corridor "Stone Corridor"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+//r:5.0
+#define qtn_profiles_3d_echo_forest "Forest"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+//r:5.0
+#define qtn_profiles_3d_echo_sewer_pipe "Sewer pipe"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+//r:5.0
+#define qtn_profiles_3d_echo_underwater "Underwater"
+
+// LOC STRINGS FOR AUDIO AND TACTILE FEEDBACK
+
+//d: Profile settings list item for tactile feedback
+//l: list_setting_pane_t1
+//r:5.0
+#define qtn_mode_tactile_feedback  "Tactile feedback"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+//r:5.0
+#define qtn_mode_tactile_feedback_off "Off"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+//r:5.0
+#define qtn_mode_tactile_feedback_level1 "Level 1"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+//r:5.0
+#define qtn_mode_tactile_feedback_level2 "Level 2"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+//r:5.0
+#define qtn_mode_tactile_feedback_level3 "Level 3"
+
+//d: Profile settings list item for tactile feedback
+//l: list_setting_pane_t1
+//r:5.0
+#define qtn_mode_audio_feedback  "Audio feedback"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+//r:5.0
+#define qtn_mode_audio_feedback_off "Off"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+//r:5.0
+#define qtn_mode_audio_feedback_level1 "Level 1"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+//r:5.0
+#define qtn_mode_audio_feedback_level2 "Level 2"
+
+//d: Profile Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+//r:5.0
+#define qtn_mode_audio_feedback_level3 "Level 3"
+
+// Power save mode
+
+// d:Error note shown when editing is blocked because of power save mode
+// l:popup_note_window
+// r:5.0
+#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/profilesapplication/Profiles/ProfileApp/tsrc/public/ProfileStif/Bmarm/ProfileStifU.DEF	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,3 @@
+EXPORTS
+	LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/tsrc/public/ProfileStif/Bwins/ProfileStifU.DEF	Wed Sep 01 12:30:29 2010 +0100
@@ -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/profilesapplication/Profiles/ProfileApp/tsrc/public/ProfileStif/EABI/ProfileStifU.def	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/tsrc/public/ProfileStif/conf/tcProfile.cfg	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,29 @@
+[Test]
+title Test NewL
+run testscripter c:\testframework\ui_Profile.cfg 1
+[Endtest]
+
+[Test]
+title Test NewLC
+run testscripter c:\testframework\ui_Profile.cfg 2
+[Endtest]
+
+[Test]
+title Test SetActiveProfileRingingTone
+run testscripter c:\testframework\ui_Profile.cfg 3
+[Endtest]
+
+[Test]
+title Test SetProfileTone
+run testscripter c:\testframework\ui_Profile.cfg 4
+[Endtest]
+
+[Test]
+title Test SetToneForAllProfiles
+run testscripter c:\testframework\ui_Profile.cfg 5
+[Endtest]
+
+[Test]
+title Test SetProfileToneNotCheckL
+run testscripter c:\testframework\ui_Profile.cfg 6
+[Endtest]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/tsrc/public/ProfileStif/conf/ui_Profile.cfg	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,42 @@
+[Test]
+title Test NewL
+create ProfileStif foobar
+foobar NewLTestL
+delete foobar
+[Endtest] 
+
+[Test]
+title Test NewLC
+create ProfileStif foobar
+foobar NewLCTestL
+delete foobar
+[Endtest] 
+
+[Test]
+title Test SetActiveProfileRingingTone
+create ProfileStif foobar
+foobar SetActiveProfileRingingToneTestL
+delete foobar
+[Endtest] 
+
+[Test]
+title Test SetProfileTone
+create ProfileStif foobar
+foobar SetProfileToneTestL
+delete foobar
+[Endtest] 
+
+[Test]
+title Test SetToneForAllProfiles
+create ProfileStif foobar
+foobar SetToneForAllProfilesTestL
+delete foobar
+[Endtest] 
+
+[Test]
+title Test SetProfileToneNotCheckL
+create ProfileStif foobar
+foobar SetProfileToneNotCheckLTestL
+delete foobar
+[Endtest] 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/tsrc/public/ProfileStif/group/ProfileStif.mmp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,75 @@
+/*TYPE TESTCLASS*/
+/*
+* 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: MMP file for STIF Test Framework's TestScripter 
+* testclass test module.
+*
+*/
+
+#include <platform_paths.hrh>
+
+TARGET          ProfileStif.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x101FB3E3
+
+CAPABILITY      ALL -TCB
+/* Remove comments and replace 0x00000000 with correct vendor id */
+// VENDORID     0x00000000
+/* Remove comments and replace 0x00000000 with correct secure id */
+// SECUREID     0x00000000
+
+//TARGETPATH      ?target_path
+DEFFILE         ProfileStif.def
+
+USERINCLUDE     ../inc 
+
+APP_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH      ../src
+
+SOURCE          ProfileStif.cpp
+SOURCE          ProfileStifBlocks.cpp
+
+
+LIBRARY         euser.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         stiftestengine.lib
+LIBRARY         ProfileSettingsView.lib // The tested library
+LIBRARY         avkon.lib eikcore.lib cone.lib eikcoctl.lib
+
+LANG            SC
+
+/*
+START WINS      
+?wins_specific_information
+END
+
+START MARM
+?marm_specific_information
+END
+*/
+// Other possible keywords:
+ 
+// DOCUMENT     ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes)
+/*
+START BITMAP ?target
+TARGETPATH   ?emulated_path_on_target_machine
+HEADER
+SOURCE       ?color_depth ?source_bitmap
+END
+*/
+// DEFFILE ?filename
+// AIF ?filename
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/tsrc/public/ProfileStif/group/ProfileStif.pkg	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,60 @@
+;
+; 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
+;
+
+; 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\ProfileStif.dll"   -   "!:\Sys\Bin\ProfileStif.dll"
+  
+; Embedded SIS 
+; None
+
+; End of Package body
+
+; PKG dependencies
+; None
+
+; PKG capabilities
+; None
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/tsrc/public/ProfileStif/group/ProfileStif_DoxyFile.txt	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,239 @@
+#
+# 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:
+#
+#
+
+# Doxyfile 1.4.1
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME           = ProfileStif
+PROJECT_NUMBER         = 
+OUTPUT_DIRECTORY       = \ProfileStif\
+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                  = \ProfileStif\
+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/profilesapplication/Profiles/ProfileApp/tsrc/public/ProfileStif/group/TestFramework.ini	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,178 @@
+#
+# 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= XXXXXXXXX
+# 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\tcProfile.cfg
+[End_Module]
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+#Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= init.txt
+
+#TestModuleXXX 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/profilesapplication/Profiles/ProfileApp/tsrc/public/ProfileStif/group/bld.inf	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,65 @@
+/*
+* 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
+// 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
+*/
+profile_z.bat		\epoc32\winscw\c\profile_z.bat
+profile_c.bat		\epoc32\winscw\c\profile_c.bat
+testframework.ini		\epoc32\winscw\c\testframework\TestFramework_profile.ini
+..\conf\tcProfile.cfg	\epoc32\winscw\c\testframework\tcProfile.cfg
+..\conf\ui_Profile.cfg	\epoc32\winscw\c\testframework\ui_Profile.cfg
+
+PRJ_TESTMMPFILES
+
+	//ProfileStif_nrm.mmp
+
+PRJ_MMPFILES
+
+	ProfileStif.mmp
+
+// 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
+*/
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/tsrc/public/ProfileStif/group/profile_c.bat	Wed Sep 01 12:30:29 2010 +0100
@@ -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_Profile.ini C:\TestFramework\TestFramework.ini
+md e:\ProfileTest
+md e:\ProfileTest\Results
+
+ATSINTERFACE.EXE -testmodule testcombiner -config C:\TestFramework\tcProfile.cfg
+copy c:\Logs\TestFramework\TestReport.txt e:\ProfileTest\results\Profile.txt
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/tsrc/public/ProfileStif/group/profile_z.bat	Wed Sep 01 12:30:29 2010 +0100
@@ -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_Profile.ini C:\TestFramework\TestFramework.ini
+md e:\ProfileTest
+md e:\ProfileTest\Results
+
+ATSINTERFACE.EXE -testmodule testcombiner -config C:\TestFramework\tcProfile.cfg
+copy c:\Logs\TestFramework\TestReport.txt e:\ProfileTest\results\Profile.txt
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/tsrc/public/ProfileStif/inc/ProfileStif.h	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,193 @@
+/*
+* 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: STIF testclass declaration
+*
+*/
+
+#ifndef PROFILESTIF_H
+#define PROFILESTIF_H
+
+//  INCLUDES
+#include <StifLogger.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include <TestclassAssert.h>
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+#define TEST_CLASS_VERSION_MAJOR 0
+#define TEST_CLASS_VERSION_MINOR 0
+#define TEST_CLASS_VERSION_BUILD 0
+
+// Logging path
+_LIT( KProfileStifLogPath, "\\logs\\testframework\\ProfileStif\\" ); 
+// Log file
+_LIT( KProfileStifLogFile, "ProfileStif.txt" ); 
+_LIT( KProfileStifLogFileWithTitle, "ProfileStif_[%S].txt" );
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class CProfileStif;
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+
+// CLASS DECLARATION
+
+/**
+*  CProfileStif test class for STIF Test Framework TestScripter.
+*  ?other_description_lines
+*
+*  @lib ?library
+*  @since ?Series60_version
+*/
+NONSHARABLE_CLASS(CProfileStif) : public CScriptBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CProfileStif* NewL( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * Destructor.
+        */
+        virtual ~CProfileStif();
+
+    public: // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    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 );
+
+    protected:  // New functions
+
+        /**
+        * ?member_description.
+        * @since ?Series60_version
+        * @param ?arg1 ?description
+        * @return ?description
+        */
+        //?type ?member_function( ?type ?arg1 );
+
+    protected:  // Functions from base classes
+
+        /**
+        * From ?base_class ?member_description
+        */
+        //?type ?member_function();
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CProfileStif( CTestModuleIf& aTestModuleIf );
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+        void ConstructL();
+
+        // Prohibit copy constructor if not deriving from CBase.
+        // ?classname( const ?classname& );
+        // Prohibit assigment operator if not deriving from CBase.
+        // ?classname& operator=( const ?classname& );
+
+        /**
+        * 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 NewLTestL( CStifItemParser& aItem );
+
+        virtual TInt NewLCTestL( CStifItemParser& aItem );
+
+        virtual TInt SetActiveProfileRingingToneTestL( CStifItemParser& aItem );
+
+        virtual TInt SetProfileToneTestL( CStifItemParser& aItem );
+	
+        virtual TInt SetToneForAllProfilesTestL( CStifItemParser& aItem );
+        
+        virtual TInt SetProfileToneNotCheckLTestL( CStifItemParser& aItem );
+        /**
+         * Method used to log version of test class
+         */
+        void SendTestClassVersion();
+
+        //ADD NEW METHOD DEC HERE
+        //[TestMethods] - Do not remove
+
+    public:     // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    protected:  // Data
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+    private:    // Data
+        
+        // ?one_line_short_description_of_data
+        //?data_declaration;
+
+        // Reserved pointer for future extension
+        //TAny* iReserved;
+
+    public:     // Friend classes
+        //?friend_class_declaration;
+    protected:  // Friend classes
+        //?friend_class_declaration;
+    private:    // Friend classes
+        //?friend_class_declaration;
+
+    };
+
+#endif      // PROFILESTIF_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/tsrc/public/ProfileStif/src/ProfileStif.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,199 @@
+/*
+* 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 contains testclass implementation.
+*
+*/
+
+// INCLUDE FILES
+#include <Stiftestinterface.h>
+#include "ProfileStif.h"
+#include <SettingServerClient.h>
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileStif::CProfileStif
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CProfileStif::CProfileStif( 
+    CTestModuleIf& aTestModuleIf ):
+        CScriptBase( aTestModuleIf )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileStif::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CProfileStif::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(KProfileStifLogFileWithTitle, &title);
+        }
+    else
+        {
+        logFileName.Copy(KProfileStifLogFile);
+        }
+
+    iLog = CStifLogger::NewL( KProfileStifLogPath, 
+                          logFileName,
+                          CStifLogger::ETxt,
+                          CStifLogger::EFile,
+                          EFalse );
+    
+    SendTestClassVersion();
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileStif::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CProfileStif* CProfileStif::NewL( 
+    CTestModuleIf& aTestModuleIf )
+    {
+    CProfileStif* self = new (ELeave) CProfileStif( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+
+    }
+
+// Destructor
+CProfileStif::~CProfileStif()
+    { 
+
+    // Delete resources allocated from test methods
+    Delete();
+
+    // Delete logger
+    delete iLog; 
+
+    }
+
+//-----------------------------------------------------------------------------
+// CProfileStif::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CProfileStif::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("ProfileStif.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* ) CProfileStif::NewL( aTestModuleIf );
+
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/tsrc/public/ProfileStif/src/ProfileStifBlocks.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,201 @@
+/*
+* 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 contains testclass implementation.
+*
+*/
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <StifParser.h>
+#include <Stiftestinterface.h>
+#include "ProfileStif.h"
+#include <CProfileToneHandler.h>
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfileStif::Delete
+// Delete here all resources allocated and opened from test methods. 
+// Called from destructor. 
+// -----------------------------------------------------------------------------
+//
+void CProfileStif::Delete() 
+    {
+
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileStif::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CProfileStif::RunMethodL( 
+    CStifItemParser& aItem ) 
+    {
+
+    static 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( "NewLTestL", CProfileStif::NewLTestL ),
+        ENTRY( "NewLCTestL", CProfileStif::NewLCTestL ),
+        ENTRY( "SetActiveProfileRingingToneTestL", CProfileStif::SetActiveProfileRingingToneTestL ),
+        ENTRY( "SetProfileToneTestL", CProfileStif::SetProfileToneTestL ),
+        ENTRY( "SetToneForAllProfilesTestL", CProfileStif::SetToneForAllProfilesTestL ),
+        ENTRY( "SetProfileToneNotCheckLTestL", CProfileStif::SetProfileToneNotCheckLTestL )
+        //ADD NEW ENTRY HERE
+        // [test cases entries] - Do not remove
+
+        };
+
+    const TInt count = sizeof( KFunctions ) / 
+                        sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileStif::ExampleL
+// Example test method function.
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+
+
+TInt CProfileStif::NewLTestL( CStifItemParser& aItem )
+	{
+    CProfileToneHandler* toneHandler = CProfileToneHandler::NewL();
+    CleanupStack::PushL( toneHandler );
+    CleanupStack::PopAndDestroy(); // toneHandler
+    return KErrNone;
+	}
+
+TInt CProfileStif::NewLCTestL( CStifItemParser& aItem )
+	{
+    CProfileToneHandler* toneHandler = CProfileToneHandler::NewLC();
+    CleanupStack::PopAndDestroy(); // toneHandler
+    return KErrNone;
+	}
+
+TInt CProfileStif::SetActiveProfileRingingToneTestL( CStifItemParser& aItem )
+	{
+	TInt err = KErrNone;
+	CProfileToneHandler* toneHandler = CProfileToneHandler::NewL();
+	CleanupStack::PushL( toneHandler );
+	err = toneHandler->SetActiveProfileRingingToneL( KNullDesC );
+	CleanupStack::PopAndDestroy(); // toneHandler
+	return err;
+	}
+
+TInt CProfileStif::SetProfileToneTestL( CStifItemParser& aItem )
+	{
+	TInt err = KErrNone;
+	CProfileToneHandler* toneHandler = CProfileToneHandler::NewL();
+	CleanupStack::PushL( toneHandler );
+	err = toneHandler->SetProfileToneL( 0, EProfileRingingToneSetting, KNullDesC );
+	CleanupStack::PopAndDestroy(); // toneHandler
+	return err;
+	}
+
+TInt CProfileStif::SetToneForAllProfilesTestL( CStifItemParser& aItem )
+	{
+	TInt err = KErrNone;
+	CProfileToneHandler* toneHandler = CProfileToneHandler::NewL();
+	CleanupStack::PushL( toneHandler );
+	err = toneHandler->SetToneForAllProfilesL( EProfileRingingToneSetting, KNullDesC );
+	CleanupStack::PopAndDestroy(); // toneHandler
+	return err;
+	}
+
+TInt CProfileStif::SetProfileToneNotCheckLTestL( CStifItemParser& aItem )
+	{
+	TInt err = KErrNone;
+	CProfileToneHandler* toneHandler = CProfileToneHandler::NewL();
+	CleanupStack::PushL( toneHandler );
+	err = toneHandler->SetProfileToneNotCheckL(0, EProfileRingingToneSetting, KNullDesC );
+	CleanupStack::PopAndDestroy(); // toneHandler
+	return err;	
+	}
+
+// -----------------------------------------------------------------------------
+// CProfileStif::?member_function
+// ?implementation_description
+// (other items were commented in a header).
+// -----------------------------------------------------------------------------
+//
+/*
+TInt CProfileStif::?member_function(
+   CItemParser& aItem )
+   {
+
+   ?code
+
+   }
+*/
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+// None
+
+//  [End of File] - Do not remove
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/tsrc/public/basic/bwins/T_ProfileSettingsViewu.def	Wed Sep 01 12:30:29 2010 +0100
@@ -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/profilesapplication/Profiles/ProfileApp/tsrc/public/basic/eabi/T_ProfileSettingsViewu.def	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,5 @@
+EXPORTS
+	_Z16CreateTestSuiteLv @ 1 NONAME
+	_ZTI21T_CProfileToneHandler @ 2 NONAME ; #<TI>#
+	_ZTV21T_CProfileToneHandler @ 3 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/tsrc/public/basic/group/T_ProfileSettingsView.mmp	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  Project definition file for Profile Settings View module tests
+*
+*/
+
+// To get the APP_LAYER_SYSTEMINCLUDE-definition
+#include <platform_paths.hrh>
+
+TARGET          T_ProfileSettingsView.dll
+TARGETTYPE      dll
+UID             0x1000af5a 0x0107FBC9
+TARGETPATH      ../../../../wins/c/DigiaEUnit/Tests
+
+CAPABILITY      ALL -TCB
+
+SOURCEPATH      ../src
+SOURCE          DllMain.cpp
+SOURCE          T_CProfileToneHandler.cpp
+
+USERINCLUDE	../inc
+
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   /epoc32/include/Digia/EUnit
+
+LIBRARY         euser.lib EUnit.lib
+LIBRARY         ProfileSettingsView.lib // The tested library
+LIBRARY         avkon.lib eikcore.lib cone.lib eikcoctl.lib
+LIBRARY         FeatMgr.lib // Feature Manager
+LIBRARY		commonengine.lib // RConeResourceLoader
+
+// Other possible keywords:
+// DOCUMENT     ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes)
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/tsrc/public/basic/group/T_ProfileSettingsView.pkg	Wed Sep 01 12:30:29 2010 +0100
@@ -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: 
+;
+; Languages
+; none -  English only by default
+&EN
+
+; Installation header
+; Only one component name as we only support English
+; UID is the main app's UID
+
+#{"BrCtlApiTest"},(0x101FB3E7),1,0,0,TYPE=SA
+(0x101F7961),0,0,0,{"Series60ProductID"}
+
+; Non-localised vendor name
+:"Nokia Corporation"
+
+; Localised vendor names
+%{"Nokia Corporation"}
+
+; Files to install and to where
+"\epoc32\Release\armv5\urel\T_ProfileSettingsView.dll"-"!:\sys\bin\T_ProfileSettingsView.dll"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/tsrc/public/basic/group/bld.inf	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  ProfileSettingsView tests.
+*
+*/
+
+////////////////////////////////////////////////////////////
+// bld.inf
+// Part of EUnit library test
+
+PRJ_PLATFORMS
+    DEFAULT
+
+PRJ_TESTEXPORTS
+
+PRJ_TESTMMPFILES
+// ModuleTests
+T_ProfileSettingsView.mmp
+
+
+
+    
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/tsrc/public/basic/inc/T_CProfileToneHandler.h	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  Test class for ProfileToneHandler.
+*
+*/
+
+
+#ifndef T_CPROFILETONEHANDLER_H
+#define T_CPROFILETONEHANDLER_H
+
+//  INCLUDES
+#include <CEUnitTestSuiteClass.h>
+
+// FORWARD DECLARATIONS
+class CProfileToneHandler;
+
+// CLASS DECLARATION
+
+/**
+*   Test class for CProfileToneHandler.
+*
+*  @lib SettingsViewMdlTest.lib
+*  @since 2.5
+*/
+class   T_CProfileToneHandler : public CEUnitTestSuiteClass
+    {
+    public:     // Constructors and destructor
+
+        static T_CProfileToneHandler* NewLC();
+        ~T_CProfileToneHandler();
+
+    private:
+
+        void SetupL();
+
+        void EmptySetupL();
+
+        void Teardown();
+
+        void NewLTestL();
+
+        void NewLCTestL();
+
+	void SetActiveProfileRingingToneTestL();
+
+	void SetProfileToneTestL();
+	
+	void SetToneForAllProfilesTestL();
+
+    private:
+
+        T_CProfileToneHandler();
+        void ConstructL();
+
+    private:    // Data
+
+        // Own: The tested class, Profile tone Handler.
+        CProfileToneHandler* iToneHandler;
+
+        EUNIT_DECLARE_TEST_TABLE;
+
+    };
+
+#endif      //  T_CPROFILETONEHANDLER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/tsrc/public/basic/rom/ProfileApp_ats3.iby	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,27 @@
+/*
+* 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 ProfileApp automated tests
+*       
+*
+*/
+
+#ifndef __PROFILEAPP_ATS3_IBY__
+#define __PROFILEAPP_ATS3_IBY__
+
+// INCLUDED IN PROFILESAPPLICATION_ATS3_IBY
+
+//file=ABI_DIR\BUILD_DIR\T_ProfileSettingsView.dll	SHARED_LIB_DIR\T_ProfileSettingsView.dll
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/tsrc/public/basic/src/DllMain.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  Profile Settings View module test suite and test class
+*                creation and DLL entry point function.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "T_CProfileToneHandler.h"
+#include <CEUnitTestSuite.h>
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CreateTestSuiteL EUnit test suite factory function.
+//                  Creates the test suite and the test classes.
+//
+// Returns: EUnit test suite interface
+// -----------------------------------------------------------------------------
+//
+EXPORT_C MEUnitTest* CreateTestSuiteL()
+    {
+    CEUnitTestSuite* mainSuite = CEUnitTestSuite::NewLC(
+        _L("ProfileSettingsView Module Tests") );
+
+    // NewLC leaves the pointer to cleanupstack until AddL finishes
+    mainSuite->AddL( T_CProfileToneHandler::NewLC() );
+    CleanupStack::Pop();
+
+    CleanupStack::Pop( mainSuite );
+    return mainSuite;
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfileApp/tsrc/public/basic/src/T_CProfileToneHandler.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,205 @@
+/*
+* 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:  Test class for CProfileIndexHandler.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    "T_CProfileToneHandler.h"
+#include    <EUnitMacros.h>
+#include    <CProfileToneHandler.h>
+
+namespace
+	{
+	}
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// T_CProfileToneHandler::T_CProfileToneHandler
+// C++ constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+T_CProfileToneHandler::T_CProfileToneHandler()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// T_CProfileToneHandler::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void T_CProfileToneHandler::ConstructL()
+    {
+    CEUnitTestSuiteClass::ConstructL();
+    }
+
+// -----------------------------------------------------------------------------
+// T_CProfileToneHandler::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+T_CProfileToneHandler* T_CProfileToneHandler::NewLC()
+    {
+    T_CProfileToneHandler* self = new( ELeave ) T_CProfileToneHandler();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// Destructor (virtual by CBase)
+T_CProfileToneHandler::~T_CProfileToneHandler()
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// T_CProfileToneHandler::SetupL
+// -----------------------------------------------------------------------------
+//
+void T_CProfileToneHandler::SetupL()
+    {
+    iToneHandler = CProfileToneHandler::NewL();
+    }
+
+// -----------------------------------------------------------------------------
+// T_CProfileToneHandler::EmptySetupL
+// -----------------------------------------------------------------------------
+//
+void T_CProfileToneHandler::EmptySetupL()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// T_CProfileToneHandler::Teardown
+// -----------------------------------------------------------------------------
+//
+void T_CProfileToneHandler::Teardown()
+    {
+    delete iToneHandler;
+    }
+
+// -----------------------------------------------------------------------------
+// T_CProfileToneHandler::NewLTestL
+// -----------------------------------------------------------------------------
+//
+void T_CProfileToneHandler::NewLTestL()
+    {
+    CProfileToneHandler* toneHandler = CProfileToneHandler::NewL();
+    CleanupStack::PushL( toneHandler );
+    EUNIT_ASSERT( toneHandler );
+    CleanupStack::PopAndDestroy(); // toneHandler
+
+    toneHandler = CProfileToneHandler::NewL( );
+    CleanupStack::PushL( toneHandler );
+    EUNIT_ASSERT( toneHandler );
+
+    CProfileToneHandler* anotherToneHandler = CProfileToneHandler::NewL( );
+    CleanupStack::PushL( anotherToneHandler );
+    EUNIT_ASSERT( anotherToneHandler );
+    CleanupStack::PopAndDestroy(); // anotherToneHandler
+
+    CleanupStack::PopAndDestroy(); // toneHandler
+    }
+
+// -----------------------------------------------------------------------------
+// T_CProfileToneHandler::NewLCTestL
+// -----------------------------------------------------------------------------
+//
+void T_CProfileToneHandler::NewLCTestL()
+    {
+    CProfileToneHandler* toneHandler = CProfileToneHandler::NewLC();
+    EUNIT_ASSERT( toneHandler );
+    CleanupStack::PopAndDestroy(); // toneHandler
+
+    toneHandler = CProfileToneHandler::NewLC( );
+    EUNIT_ASSERT( toneHandler );
+
+    CProfileToneHandler* anotherToneHandler = CProfileToneHandler::NewLC( );
+    EUNIT_ASSERT( anotherToneHandler );
+    CleanupStack::PopAndDestroy(); // anotherToneHandler
+
+    CleanupStack::PopAndDestroy(); // toneHandler
+    }
+
+// -----------------------------------------------------------------------------
+// T_CProfileToneHandler::SetActiveProfileRingingToneTestL
+// -----------------------------------------------------------------------------
+//
+void T_CProfileToneHandler::SetActiveProfileRingingToneTestL()
+    {
+    iToneHandler->SetActiveProfileRingingToneL( KNullDesC );
+    }
+
+// -----------------------------------------------------------------------------
+// T_CProfileToneHandler::SetProfileToneTestL
+// -----------------------------------------------------------------------------
+//
+void T_CProfileToneHandler::SetProfileToneTestL()
+    {
+    iToneHandler->SetProfileToneL( 0, EProfileRingingToneSetting, KNullDesC );
+    }
+    
+// -----------------------------------------------------------------------------
+// T_CProfileToneHandler::SetToneForAllProfilesTestL
+// -----------------------------------------------------------------------------
+//
+void T_CProfileToneHandler::SetToneForAllProfilesTestL()
+    {
+    iToneHandler->SetToneForAllProfilesL( EProfileRingingToneSetting, KNullDesC );
+    }    
+    
+// ========================== EUNIT TEST CASES =================================
+
+EUNIT_BEGIN_TEST_TABLE(
+    T_CProfileToneHandler, // Name of the tester class
+    "T_CProfileToneHandler test suite.", // Textual description of the test suite.
+    "MODULE" )
+
+EUNIT_TEST(
+    "NewLTestL",
+    "CProfileToneHandler",
+    "NewL",
+    "FUNCTIONALITY",
+    EmptySetupL, NewLTestL, Teardown )
+EUNIT_TEST(
+    "NewLCTestL",
+    "CProfileToneHandler",
+    "NewLC",
+    "FUNCTIONALITY",
+    EmptySetupL, NewLCTestL, Teardown )
+EUNIT_TEST(
+    "SetProfileToneTestL",
+    "CProfileToneHandler",
+    "SetProfileToneL",
+    "FUNCTIONALITY",
+    SetupL, SetProfileToneTestL, Teardown )
+EUNIT_TEST(
+    "SetActiveProfileRingingToneTestL",
+    "CProfileToneHandler",
+    "SetActiveProfileRingingToneL",
+    "FUNCTIONALITY",
+    SetupL, SetActiveProfileRingingToneTestL, Teardown )
+EUNIT_TEST(
+    "SetToneForAllProfilesTestL",
+    "CProfileToneHandler",
+    "SetToneForAllProfilesL",
+    "FUNCTIONALITY",
+    SetupL, SetToneForAllProfilesTestL, Teardown )    
+
+EUNIT_END_TEST_TABLE
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfilesGSTonesPlugin/data/1020729B.rss	Wed Sep 01 12:30:29 2010 +0100
@@ -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:    ECOM resource file for plugin.
+*
+*/
+
+#include <RegistryInfo.rh>
+#include "ProfilesUID.h"
+
+
+RESOURCE REGISTRY_INFO theInfo
+	{
+	dll_uid     = IMPLEMENTATION_UID_PROFILES_GS_TONES_PLUGIN;
+	interfaces  = 
+		{
+		INTERFACE_INFO
+			{
+			interface_uid   = 0x10207236;
+			implementations = 
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid  = IMPLEMENTATION_UID_PROFILES_GS_TONES_PLUGIN;
+					version_no          = 1;
+					display_name        = "Tones View Plugin"; // Debug name
+					default_data        = "0x10207252";// Parent UID (Personalisation)
+					opaque_data         = "2";// Order number
+					}
+				};
+			}
+		};
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfilesGSTonesPlugin/data/ProfilesGSTonesPluginRsc.rss	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,354 @@
+/*
+* 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    TNVW // 4 letter ID
+
+//  INCLUDES
+
+#include    <data_caging_paths_strings.hrh>
+#include    <bldvariant.hrh>
+#include    <avkon.loc> // Avkon localized strings
+#include <profile.hrh>
+#include <profilesettingsview.hrh>
+#include <profileinternal.hrh>
+#include <ProfileEng.hrh>
+#include <eikon.rh>
+#include <avkon.rh>
+#include    <avkon.mbg>
+#include    <avkon.rsg>
+#include    <eikcore.rsg>
+#include    <uikon.rh>
+#include    "ProfilesGsTonesPlugin.hrh"
+#include    <profilesgstonesplugin.loc>
+#include    <profileapp.loc>
+// FileListModel path definitions
+#include <PathConfiguration.hrh>
+// FileListModel structure
+#include <filelistmodel.rh>
+
+// CONSTANTS
+
+//  RESOURCE DEFINITIONS
+
+//----------------------------------------------------
+//
+//
+//    Needed or loading the resource fails!
+//
+//----------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE
+    {
+    }
+
+// Include the common part of the resources (of application and plugin):
+#include    "ProfileSettingsViewCommon.rss"
+
+//----------------------------------------------------
+//
+//    r_profiles_gs_tones_view
+//    Tones view.
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_profiles_gs_tones_view
+    {
+    menubar = r_profiles_gs_options_menubar;
+    cba = r_profiles_gs_tones_view_softkeys_options_back_change;
+    }
+
+//----------------------------------------------------
+//
+//    r_profiles_gs_tones_view_softkeys_options_back_change
+//    Tones view cba.
+//
+//----------------------------------------------------
+//
+RESOURCE CBA r_profiles_gs_tones_view_softkeys_options_back_change
+    {
+    flags = 0;
+    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_profiles_gs_tones_view_title
+//    Tones view title.
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_profiles_gs_tones_view_title
+    {
+    buf = qtn_set_title_pers_tones;
+    }
+
+//----------------------------------------------------
+//
+//    r_profiles_gs_tones_view_caption
+//    Tones view caption for plugin
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_profiles_gs_tones_view_caption
+    {
+    buf = qtn_set_pers_tones;
+    }
+
+//----------------------------------------------------
+//
+//    r_profiles_gs_tones_view_updated_note
+//    Active profile changed. View updated -note
+//
+//----------------------------------------------------
+//
+RESOURCE TBUF r_profiles_gs_tones_view_updated_note
+    {
+    buf = qtn_profiles_info_tones_view_updated;
+    }
+
+//----------------------------------------------------
+//   
+//    r_profiles_gs_options_menubar
+//    Options menu with 'Change' and 'Exit' items.
+//
+//----------------------------------------------------
+//
+RESOURCE MENU_BAR r_profiles_gs_options_menubar
+    {
+    titles =
+        {
+        MENU_TITLE 
+            { 
+            menu_pane = r_profiles_gs_options_menupane;
+            }
+        };
+    }
+ 
+//----------------------------------------------------
+//   
+//    r_profiles_gs_menu_item_change
+//    Options menu item 'Change'.
+//
+//----------------------------------------------------
+//
+RESOURCE MENU_PANE r_profiles_gs_menu_item_change
+    {
+    items =
+        {
+        MENU_ITEM 
+            {
+            command = EProfilesGsTonesCmdChange;
+            txt = qtn_options_change;
+            }
+        };
+    }
+
+//----------------------------------------------------
+//   
+//    r_profiles_gs_options_menupane
+//    Options menu of GS tones view
+//
+//----------------------------------------------------
+//
+RESOURCE MENU_PANE r_profiles_gs_options_menupane
+    {
+    items =
+        {
+        MENU_ITEM 
+            {
+            command = EProfilesGsTonesCmdChange;
+            txt = qtn_options_change;
+            },
+        MENU_ITEM
+            {
+            command = EAknCmdHelp;
+            txt = qtn_options_help;
+            },
+        MENU_ITEM 
+            {
+            command = EAknCmdExit;
+            txt = qtn_options_exit;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_gs_tones_view_setting_item_list
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_SETTING_ITEM_LIST r_profile_gs_tones_view_setting_item_list
+    {
+    items =
+        {
+        AVKON_SETTING_ITEM
+            {
+            identifier = EProfileSettingRingingToneId;
+            name = qtn_mode_ringing_tone;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EProfileSettingRingingToneLine1Id;
+            name = qtn_mode_line1_tone;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EProfileSettingRingingToneLine2Id;
+            name = qtn_mode_line2_tone;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EProfileSettingVideoCallToneId;
+            name = qtn_mode_vt_tone;
+            },
+		AVKON_SETTING_ITEM
+	    	{
+	    	identifier = EProfileSettingTTSRingingToneId;
+	    	name = qtn_mode_tts_ringing_tone;
+	    	setting_page_resource = r_profile_tts_tones_setting_page;
+	    	associated_resource = r_profile_tts_setting_texts;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EProfileSettingRingingTypeId;
+            name = qtn_mode_ringing_type_2;
+            setting_page_resource = r_profile_ringing_type_setting_page;
+            associated_resource = r_profile_ringing_type_setting_texts;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EProfileSettingRingingVolumeId;
+            name = qtn_mode_ringing_volume;
+            setting_page_resource = r_profile_ringing_volume_setting_page;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EProfileSettingMessageAlertToneId;
+            name = qtn_mode_message_tone;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EProfileSettingEmailAlertToneId;
+            name = qtn_profiles_e_mail_tone;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EProfileGSTonesPluginSettingCalendarToneId;
+            name = qtn_profiles_calendar_tone;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EProfileGSTonesPluginSettingClockToneId;
+            name = qtn_profiles_clock_tone;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EProfileSettingVibratingAlertId;
+            name = qtn_mode_vibrating_alert;
+            setting_page_resource = r_profile_vibrating_alert_setting_page;
+            associated_resource = r_profile_vibrating_alert_setting_texts;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EProfileSettingKeypadVolumeId;
+            name = qtn_mode_keypad_volume;
+            setting_page_resource = r_profile_keypad_volume_setting_page;
+            associated_resource = r_profile_keypad_volume_setting_texts;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EProfileSettingWarningAndGameTonesId;
+            name = qtn_mode_warning_game;
+            setting_page_resource = r_profile_warning_tones_setting_page;
+            associated_resource = r_profile_warning_alert_setting_texts;
+            },
+        AVKON_SETTING_ITEM
+            {
+            identifier = EProfileGSTonesPluginSettingHacModeId;
+            name = qtn_set_audio_hac_mode;
+            setting_page_resource = r_profile_hac_mode_setting_page;
+            associated_resource = r_profile_hac_mode_setting_texts;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_qtn_no_personal_tone
+// Default tone text used in Calendar/Clock alarm tone selection list.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_qtn_no_personal_tone
+    {
+    buf = qtn_tc_no_personal_tone;
+    }
+    
+// -----------------------------------------------------------------------------
+//
+// r_profile_hac_mode_setting_page
+// Setting page resource for Hearing aid compatibility setting item.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_SETTING_PAGE r_profile_hac_mode_setting_page
+    {
+    label = qtn_set_audio_hac_mode;
+    softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK;
+    type = EAknCtPopupSettingList;
+    editor_resource_id = r_profile_empty_popup_setting_list_control;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_vibrating_alert_setting_texts
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_POPUP_SETTING_TEXTS r_profile_hac_mode_setting_texts
+    {
+    setting_texts_resource = r_profile_hac_mode_texts_and_values;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// r_profile_vibrating_alert_texts_and_values
+// ?description
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_profile_hac_mode_texts_and_values
+    {
+    items =
+        {
+        AVKON_ENUMERATED_TEXT { value = 1;  text = qtn_set_audio_hac_mode_on; },
+        AVKON_ENUMERATED_TEXT { value = 0;  text = qtn_set_audio_hac_mode_off; }
+        };
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfilesGSTonesPlugin/group/ProfilesGSTonesPlugin.mmp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,95 @@
+/*
+* 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.
+*
+*/
+
+// To get the APP_LAYER_SYSTEMINCLUDE-definition
+#include <platform_paths.hrh>
+#include            <data_caging_paths.hrh>    // For RESOURCE_FILES_DIR
+
+CAPABILITY          CAP_ECOM_PLUGIN
+TARGET              ProfilesGSTonesPlugin.dll
+TARGETTYPE          PLUGIN
+UID                 0x10009D8D 0x1020729B
+VENDORID            VID_DEFAULT
+
+SOURCEPATH          ../src
+SOURCE              CProfilesGSTonesViewFeatures.cpp
+SOURCE              CProfilesGSTonesViewSettings.cpp
+SOURCE              CProfilesGSTonesPluginFileListSettingItem.cpp
+SOURCE              CProfilesGSTonesPluginSettingsHandler.cpp
+SOURCE              CProfilesGSTonesPluginSettingsHandlerDrmFull.cpp
+LIBRARY 		    drmhelper.lib
+SOURCE              ProfilesGSTonesPlugin.cpp
+SOURCE              ProfilesGSTonesPluginImplementationTable.cpp
+
+SOURCEPATH          ../../ProfileApp/UiSrc
+SOURCE              CProfileNaviPaneContainer.cpp
+
+USERINCLUDE         ../../group
+USERINCLUDE         ../../ProfileApp/group
+USERINCLUDE         ../src
+USERINCLUDE         ../inc
+USERINCLUDE         ../data
+
+SYSTEMINCLUDE       ../../ProfileApp/SettingsViewInc
+SYSTEMINCLUDE       ../../ProfileApp/SettingsViewSrc
+SYSTEMINCLUDE       ../../ProfileApp/UiSrc
+SYSTEMINCLUDE       ../../ProfileEngine/EngInc
+SYSTEMINCLUDE	../../../inc
+
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE       /epoc32/include/ecom
+
+
+SOURCEPATH          ../data
+
+START RESOURCE      1020729B.rss
+TARGET              ProfilesGSTonesPlugin.rsc
+END
+
+// View resources
+START RESOURCE      ProfilesGSTonesPluginRsc.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             commonengine.lib// For RConeResourceLoader
+LIBRARY             featmgr.lib // Feature Manager
+LIBRARY             GSEcomPlugin.lib
+LIBRARY             GSFramework.lib
+LIBRARY             centralrepository.lib          
+LIBRARY 		    CenRepNotifHandler.lib
+LIBRARY 		    filelist.lib
+LIBRARY 		    profilesettingsview.lib
+LIBRARY 		    hlplch.lib
+LIBRARY 		    ProfileEng.lib
+LIBRARY             aknnotify.lib // CAknGlobalNote
+
+
+
+// End of File
+SOURCEPATH ../src
+SOURCE CProfilesGSTonesPluginSettingsHandlerDrmEmpty.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfilesGSTonesPlugin/group/bld.inf	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,33 @@
+/*
+* 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 ProfilesGSTones.
+*
+*/
+
+// To get the APP_LAYER_LOC_EXPORT_PATH-definition
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+    DEFAULT
+
+PRJ_EXPORTS
+../loc/ProfilesGSTonesPlugin.loc    APP_LAYER_LOC_EXPORT_PATH(profilesgstonesplugin.loc)
+
+PRJ_MMPFILES
+
+#ifdef RD_GS_RENOVATION
+ProfilesGSTonesPlugin.mmp
+#endif // RD_GS_RENOVATION
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfilesGSTonesPlugin/inc/ProfilesGSTonesPlugin.h	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,195 @@
+/*
+* 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 PROFILESGSTONESPLUGIN_H
+#define PROFILESGSTONESPLUGIN_H
+
+// Includes
+#include <GSPluginInterface.h>
+#include <coneresloader.h>
+#include <MProfileViewHandler.h>
+#include <MProfileChangeObserver.h>
+
+
+// FORWARD DECLARATIONS
+class CProfileSettingsContainer;
+class CProfileGSTonesTopControl;
+class CProfilesGSTonesPluginSettingsHandler;
+class CProfileEngineHandler;
+class MProfilesLocalFeatures;
+class CProfileChangeNotifyHandler;
+class CProfileNaviPaneContainer;
+
+// CLASS DECLARATION
+
+
+/**
+* This interceptor control sits on top of the component stack. Its only purpose
+* is to route focus events to CProfileSettingsContainer. Key events are not
+* handled at all, they just fall through this component.
+*/
+NONSHARABLE_CLASS( CProfileGSTonesTopControl ) : public CCoeControl
+	{
+	public:
+
+		static CProfileGSTonesTopControl* NewL( CCoeControl* aFocusControl );
+		void FocusChanged( TDrawNow aDrawNow );
+
+	private:
+        CCoeControl* iFocusControl;
+	};
+
+
+
+
+/**
+* CProfilesGSTonesPlugin view class.
+*
+* @since Series60_3.1
+*/
+class CProfilesGSTonesPlugin : public CGSPluginInterface,
+    public MProfileChangeObserver,
+    public MProfileViewHandler
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Symbian OS two-phased constructor
+        * @return 
+        */
+        static CProfilesGSTonesPlugin* NewL( TAny* aInitParams );
+    
+        /**
+        * Destructor.
+        */
+        ~CProfilesGSTonesPlugin();
+
+    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();
+        
+        /**
+        * See base class.
+        */
+        void HandleCommandL( TInt aCommand );
+
+        /**
+        * See base class.
+        */
+        void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+   
+    public: // From CGSPluginInterface
+        
+        /**
+        * See base class.
+        */
+        void GetCaptionL( TDes& aCaption ) const;
+        
+        /**
+        * See base class.
+        */
+        TGSListboxItemTypes ItemType();
+
+        /**
+        * See base class.
+        */
+        TInt PluginProviderCategory() const;
+    
+        /**
+        * From MProfileChangeObserver
+        */
+        void HandleActiveProfileEventL(
+            TProfileEvent aProfileEvent, TInt aProfileId );
+
+        /**
+        * From MProfileViewHandler
+        */
+		virtual void UpdateClientRect();
+
+        /**
+        * From MProfileViewHandler
+        */
+		virtual CAknView& View();
+
+    protected: // New functions
+
+        /**
+         * Shows the information note with the text found from the given
+         * resource.
+         * @param aResourceId The ID of the resource containing the text to be
+         *        shown.
+         */
+        void ShowInfoNoteL( TInt aResourceId );
+
+    protected: // Constructors
+        /**
+        * C++ default constructor.
+        */
+        CProfilesGSTonesPlugin();
+
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+        
+    private: // Data
+        
+        // Resource loader.
+        RConeResourceLoader iResourceLoader;
+        
+        /// Own: Container for the profile settings
+        CProfileSettingsContainer* iContainer;
+
+        /// Own: control needed to get the focus on listbox
+        CProfileGSTonesTopControl* iTopControl;
+
+        /// Own: handler for the settings external to Profiles
+        CProfilesGSTonesPluginSettingsHandler* iSettingsHandler;
+
+        /// Own: handler for Profiles Engine
+        CProfileEngineHandler* iEngineHandler;
+
+        // Own: Profile change notify handler.
+        CProfileChangeNotifyHandler* iNotifier;
+
+        // Own: Navi pane container.
+        CProfileNaviPaneContainer* iNaviPaneContainer;
+
+        // The ID of the previously active profile
+        TInt iPreviousProfile;
+    };
+
+
+#endif // PROFILESGSTONESPLUGIN_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfilesGSTonesPlugin/inc/ProfilesGSTonesPlugin.hrh	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2003, 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 header file for the plugin.
+*
+*/
+
+
+#ifndef PROFILESGSTONESPLUGIN_HRH
+#define PROFILESGSTONESPLUGIN_HRH
+
+// CONSTANTS
+
+// DATA TYPES
+
+enum TProfilesGsTonesCommandIds
+    {
+    EProfilesGsTonesCmdChange = 1      // available from menu in settings list
+    };
+    
+enum TProfileGSTonesSettingItemIds
+    {
+    // Start from 100 to not to collapse with the setting item IDs in Profiles
+    // App:
+    EProfileGSTonesPluginSettingCalendarToneId = 100,
+    EProfileGSTonesPluginSettingClockToneId = 101,
+    EProfileGSTonesPluginSettingHacModeId = 102
+    };
+
+#endif // PROFILESGSTONESPLUGIN_HRH
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfilesGSTonesPlugin/loc/ProfilesGsTonesPlugin.loc	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,109 @@
+/*
+* Copyright (c) 2006-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 Project ProfilesGsTonesPlugin.
+*
+*/
+
+
+/*
+  The syntax of a logical name entry in this file is the following:
+
+  // d:context description (line 1)
+  // d:context description (line N)
+  // l:layout id
+  // w:
+  // r:release information
+  //
+  #define qtn_<?feature_or_application>_?freetext "?text"
+
+  where
+      "qtn_" starts a logical name.  Note: "text_" has been used in
+           old logical names, but is deprecated.
+      "?feature/application" is 2-5 lower-case characters and/or numbers
+           identifying the larger context of the display text.
+      "?freetext" is the free text portion of the logical name.
+           It may contain only lower-case letters ('a' to 'z'), numbers
+           ('0' to '9'), and the underscore ('_').  The total length of
+           the logical name does must not exceed 50 characters.
+      "d:" Starts a description line clarifying the entry's context with
+           information like:
+           - Is a word a verb in imperative or is it a noun?  (For instance,
+             what does "Set" mean?)
+           - What will replace %U (unicode text parameter) or %N (number
+             parameter) included in texts?  (For instance, is it a phone
+             number or an e-mail address?)
+      "l:" Starts a layout id information (one line).
+           "P" and "No" are symbols in LAF's information table
+                - "P" is parent pane or current pane
+                - "No" is reference number in table
+      "r:" Starts a release information: one line indicating in which
+           S60 release the text was used for the first time.
+
+*/
+
+
+// d:List pane text in General Settings Personalisation view.
+// l:list_setting_pane_t1
+// r:3.1u
+//
+#define qtn_set_pers_tones "Tones"
+
+// d:Title pane text in General Settings Tones view.
+// l:title_pane_t2/opt9
+// r:3.1u
+//
+#define qtn_set_title_pers_tones "Tones"
+
+// d:List pane text for calendar alert tone in General Settings Tones view.
+// l:list_setting_pane_t1
+// r:3.1u
+//
+#define qtn_profiles_calendar_tone "Calendar alert tone"
+
+// d:List pane text for clock alert tone in General Settings Tones view.
+// l:list_setting_pane_t1
+// r:3.1u
+//
+#define qtn_profiles_clock_tone "Clock alert tone"
+
+//d:Default tone selection choice in alarm tone list for Calendar and Clock
+//l:list_set_graphic_pane_t1
+//
+#define qtn_tc_no_personal_tone  "Default tone"
+
+//d: Notification about updating of Tones View when the active profile is
+//d: changed.
+//l: popup_note_window
+#define qtn_profiles_info_tones_view_updated "Active profile changed. View updated."
+
+// LOC STRINGS FOR HAC HEARING AID SETTING
+
+// d:List pane text for hearing aid setting in General Settings Tones view.
+// l:list_setting_pane_t1
+// r:3.1
+//
+#define qtn_set_audio_hac_mode "T-coil hearing aid mode"
+
+//d: Profile GS Tones View Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+//r:3.1
+#define qtn_set_audio_hac_mode_on "On"
+
+//d: Profile GS Tones View Settings Item Edit - setting selection data
+//l: list_set_graphic_pane_t1
+//r:3.1
+#define qtn_set_audio_hac_mode_off "Off"
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfilesGSTonesPlugin/src/CProfilesGSTonesPluginFileListSettingItem.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,370 @@
+/*
+* 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:  Setting item class for tone selection.
+*
+*/
+
+
+
+// CLASS HEADER
+#include "CProfilesGSTonesPluginFileListSettingItem.h"
+
+// INTERNAL INCLUDES
+#include <Profile.hrh> // From Profile Engine
+#include <ProfileSettingsView.hrh>
+#include "ProfilesGSTonesPlugin.hrh"
+#include <profilesgstonespluginrsc.rsg>
+#include "MProfilesGSTonesPluginItemDataInterface.h"
+#include "ProfilesDebug.h"
+
+// SYSTEM INCLUDES
+#include <centralrepository.h>
+#include <coemain.h>
+#include <CFLDFileListContainer.h>
+#include <stringloader.h>
+#include <data_caging_path_literals.hrh>
+#include <ProfileEngineInternalCRKeys.h>
+#include <HWRMVibraSDKCRKeys.h>
+#include <CLFContentListing.hrh>
+
+namespace
+	{
+// CONSTANTS
+	_LIT( KIgnoredExtension, ".RNG" );
+	_LIT( KProfileSilentTone, "Z:No_Sound.wav" );
+    // MIME types that should not be shown by FileList
+    _LIT( KProfileTypeMpegUrl, "audio/mpegurl" );
+    _LIT( KProfileTypeRaPlugin, "audio/x-pn-realaudio-plugin" );
+#ifndef __WMA
+    _LIT( KProfileTypeWma, "audio/x-ms-wma" );
+#endif
+	}
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesPluginFileListSettingItem::CProfilesGSTonesPluginFileListSettingItem
+// C++ constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CProfilesGSTonesPluginFileListSettingItem::CProfilesGSTonesPluginFileListSettingItem(
+    TInt aIdentifier,
+    const TDesC& aDefaultToneFileName,
+    CCoeEnv* aCoeEnv,
+    MProfilesGSTonesPluginItemDataInterface& aDataInterface )
+    :   CAknSettingItem( aIdentifier ),
+        iDefaultToneFileName( aDefaultToneFileName ),
+        iCoeEnv( aCoeEnv ),
+        iDataInterface( aDataInterface )
+    {
+    }
+
+// Destructor
+CProfilesGSTonesPluginFileListSettingItem::~CProfilesGSTonesPluginFileListSettingItem()
+    {
+    PRODEBUG( "~CProfilesGSTonesPluginFileListSettingItem" );
+	if( iVibraNotifyHandler )
+		{
+		iVibraNotifyHandler->StopListening();
+		}
+
+	if( iTypeNotifyHandler )
+		{
+		iTypeNotifyHandler->StopListening();
+		}
+
+	if( iVolumeNotifyHandler )
+		{
+		iVolumeNotifyHandler->StopListening();
+		}
+
+    delete iVibraNotifyHandler;
+	delete iTypeNotifyHandler;
+    delete iVolumeNotifyHandler;
+
+    delete iSession;
+    delete iVibraSession;
+
+    delete iTitle;
+    delete iNoSoundFileName;
+    delete iNoSoundText;
+
+    delete iDefaultToneText;
+    delete iFileListContainer;
+    PRODEBUG( "~CProfilesGSTonesPluginFileListSettingItem end" );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesPluginFileListSettingItem::CompleteConstructionL
+// -----------------------------------------------------------------------------
+//
+void CProfilesGSTonesPluginFileListSettingItem::CompleteConstructionL()
+    {
+    PRODEBUG( "CProfilesGSTonesPluginFileListSettingItem::CompleteConstr begin" );
+    iNoSoundText =
+		StringLoader::LoadL( R_PROFILE_TEXT_NONE );
+
+	TFileName fileName;
+	TParse* fp = new(ELeave) TParse();
+	fp->Set(KProfileSilentTone, &KDC_RESOURCE_FILES_DIR, NULL);
+	fileName.Copy( fp->FullName() );
+	delete fp;
+	iNoSoundFileName = fileName.AllocL();
+    iTitle =
+        StringLoader::LoadL( R_PROFILE_TEXT_SELECT_TONE );
+
+    iVibraSession = CRepository::NewL(KCRUidVibraCtrl);
+    iSession = CRepository::NewL(KCRUidProfileEngine);
+    ReadMaxToneFileSizeL( *iSession );
+
+	iVibraNotifyHandler = CCenRepNotifyHandler::NewL(*this,
+            *iVibraSession,
+            CCenRepNotifyHandler::EIntKey,
+            KVibraCtrlProfileVibraEnabled);
+
+    User::LeaveIfError( iVibraSession->Get( KVibraCtrlProfileVibraEnabled, iVibratingAlert ) );
+
+    iVibraNotifyHandler->StartListeningL();
+
+    if( Identifier() == EProfileGSTonesPluginSettingCalendarToneId )
+        {
+        iVolumeNotifyHandler = CCenRepNotifyHandler::NewL(*this,
+                *iSession,
+                CCenRepNotifyHandler::EIntKey,
+                KProEngActiveRingingVolume);
+
+        iTypeNotifyHandler = CCenRepNotifyHandler::NewL(*this,
+                *iSession,
+                CCenRepNotifyHandler::EIntKey,
+                KProEngActiveRingingType);
+
+        User::LeaveIfError( iSession->Get( KProEngActiveRingingVolume,
+                                           iRingingVolume ) );
+        User::LeaveIfError( iSession->Get( KProEngActiveRingingType,
+                                           iRingingType ) );
+
+        iVolumeNotifyHandler->StartListeningL();
+        iTypeNotifyHandler->StartListeningL();
+        }
+
+    iDefaultToneText = StringLoader::LoadL(R_QTN_NO_PERSONAL_TONE, iCoeEnv);
+    iInternalToneFileName.Copy( iDataInterface.ItemData() );
+    PRODEBUG( "CProfilesGSTonesPluginFileListSettingItem::CompleteConstr end" );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesPluginFileListSettingItem::StoreL
+// -----------------------------------------------------------------------------
+//
+void CProfilesGSTonesPluginFileListSettingItem::StoreL()
+    {
+    if( iInternalToneFileName.Length() == 0 )
+        {
+        iInternalToneFileName = *iNoSoundFileName; // No_Sound.wav
+        }
+    iDataInterface.SetItemDataL( iInternalToneFileName );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesPluginFileListSettingItem::LoadL
+// -----------------------------------------------------------------------------
+//
+void CProfilesGSTonesPluginFileListSettingItem::LoadL()
+    {
+    iInternalToneFileName.Copy( iDataInterface.ItemData() );
+    if( iInternalToneFileName.Length() == 0 )
+        {
+        iInternalToneFileName = *iNoSoundFileName;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesPluginFileListSettingItem::EditItemL
+// -----------------------------------------------------------------------------
+//
+void CProfilesGSTonesPluginFileListSettingItem::EditItemL( TBool /* aCalledFromMenu */ )
+    {
+    PRODEBUG( "CProfilesGSTonesPluginFileListSettingItem::EditItemL begin" );
+    TInt ringingType( iRingingType );
+    TInt volume( iRingingVolume );
+    TInt id( Identifier() );
+    if( id == EProfileGSTonesPluginSettingCalendarToneId )
+        {
+        if( ( ringingType != EProfileRingingTypeBeepOnce ) &&
+            ( ringingType != EProfileRingingTypeSilent ) )
+            {
+            ringingType = EProfileRingingTypeRinging;
+            }
+        }
+    else // Clock alert tone
+        {
+        ringingType = EProfileRingingTypeRinging;
+        volume = EProfileRingingVolumeLevel7;
+        }
+
+    PRODEBUG( "CProfilesGSTonesPluginFileListSettingItem::EditItemL before FLD constr" );
+
+    iFileListContainer = CFLDFileListContainer::NewL();
+    PRODEBUG( "CProfilesGSTonesPluginFileListSettingItem::EditItemL after FLD constr" );
+
+
+    iFileListContainer->InsertNullItemL( *iDefaultToneText, iDefaultToneFileName );
+    // Add "Off" as the last item in tone selection list.
+    iFileListContainer->InsertEndNullItemL( *iNoSoundText, *iNoSoundFileName );
+    iFileListContainer->SetRingingType( ringingType );
+    iFileListContainer->SetVolume( volume );
+    iFileListContainer->SetVibra( iVibratingAlert );
+    iFileListContainer->AddExclusiveMimeTypeL( KProfileTypeMpegUrl );
+    iFileListContainer->AddExclusiveMimeTypeL( KProfileTypeRaPlugin );
+#ifndef __WMA
+    iFileListContainer->AddExclusiveMimeTypeL( KProfileTypeWma );
+#endif
+    iFileListContainer->AddExclusiveMediaTypeL( ECLFMediaTypeVideo );
+
+    if( id == EProfileGSTonesPluginSettingCalendarToneId )
+        {
+        iFileListContainer->SetAutomatedType(
+                CDRMHelper::EAutomatedTypeCalendarAlarm );
+        }
+    else
+        {
+        iFileListContainer->SetAutomatedType(
+                CDRMHelper::EAutomatedTypeClockAlarm );
+        }
+
+    // Size limit for voice call tone files
+    if ( ( id == EProfileSettingRingingToneId      ||
+           id == EProfileSettingRingingToneLine1Id ||
+           id == EProfileSettingRingingToneLine2Id ) && iSizeLimit )
+        {
+        iFileListContainer->SetMaxFileSize( iSizeLimit );
+        }
+		
+    // Launch File List Dialog
+    PRODEBUG( "CProfilesGSTonesPluginFileListSettingItem::EditItemL before FLD launch" );
+    TBool returnValue( iFileListContainer->LaunchL( iInternalToneFileName, *iTitle ) );
+    PRODEBUG( "CProfilesGSTonesPluginFileListSettingItem::EditItemL after FLD launch" );
+    if( returnValue )
+        {
+        // Setting Oked.
+        iDataInterface.SetItemDataL( iInternalToneFileName ); 
+        UpdateListBoxTextL();
+        }
+
+    delete iFileListContainer;
+    iFileListContainer = NULL;
+    PRODEBUG( "CProfilesGSTonesPluginFileListSettingItem::EditItemL end" );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesPluginFileListSettingItem::SettingTextL
+// -----------------------------------------------------------------------------
+//
+const TDesC& CProfilesGSTonesPluginFileListSettingItem::SettingTextL()
+    {
+    PRODEBUG( "CProfilesGSTonesPluginFileListSettingItem::SettingTextL begin" );
+    if( iInternalToneFileName.Length() > 0 )
+        {
+        // FLD has returned a filename
+        if( iInternalToneFileName.CompareF( *iNoSoundFileName ) == 0 )
+            {
+            // Filename is "No_Sound", return localized text "None"
+            iSettingText.Set( *iNoSoundText );
+            }
+        else if( iInternalToneFileName.CompareF( iDefaultToneFileName ) == 0 )
+            {
+            // Filename is "No_Sound", return localized text "None"
+            iSettingText.Set( *iDefaultToneText );
+            }
+        else
+            {
+            // Filename is something else
+            TParsePtrC parse( iInternalToneFileName );
+            if( parse.Ext().CompareF( KIgnoredExtension ) == 0 )
+                {
+                iSettingText.Set( parse.Name() );
+                }
+            else
+                {
+                iSettingText.Set( parse.NameAndExt() );
+                }
+            }
+        }
+    else
+        {
+        // Filename is an empty descriptor, return localised text "None"
+        iSettingText.Set( *iNoSoundText );
+        }
+    PRODEBUG( "CProfilesGSTonesPluginFileListSettingItem::SettingTextL end" );
+    return iSettingText;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesPluginFileListSettingItem::HandleNotifyInt
+// -----------------------------------------------------------------------------
+//
+void CProfilesGSTonesPluginFileListSettingItem::HandleNotifyInt( TUint32 aId,
+        TInt aNewValue )
+    {
+    switch( aId )
+        {
+        case KVibraCtrlProfileVibraEnabled:
+            {
+            iVibratingAlert = aNewValue;
+            if( iFileListContainer )
+                {
+                iFileListContainer->SetVibra( iVibratingAlert );
+                }
+            break;
+            }
+        case KProEngActiveRingingType:
+            {
+            iRingingType = aNewValue;
+            if( iFileListContainer )
+                {
+                iFileListContainer->SetRingingType( iRingingType );
+                }
+            break;
+            }
+        default: // KProEngActiveRingingVolume 
+            {
+            iRingingVolume = aNewValue;
+            if( iFileListContainer )
+                {
+                iFileListContainer->SetVolume( iRingingVolume );
+                }
+            break;
+            }
+        }
+
+    }
+
+// -----------------------------------------------------------------------------
+// CProfileFileListSettingItem::ReadMaxToneFileSizeL
+// -----------------------------------------------------------------------------
+//
+void CProfilesGSTonesPluginFileListSettingItem::ReadMaxToneFileSizeL(
+        CRepository& aRepository )
+    {
+    // Set file size limit if configured ON.
+	User::LeaveIfError( aRepository.Get( KProEngRingingToneMaxSize,
+                                         iSizeLimit ) );
+	if ( iSizeLimit < 0 )
+	    {
+	    iSizeLimit = 0;
+	    }
+	iSizeLimit *= KKilo;
+    }
+
+// End Of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfilesGSTonesPlugin/src/CProfilesGSTonesPluginFileListSettingItem.h	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,172 @@
+/*
+* 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:  Setting item class for tone selection.
+*
+*/
+
+
+
+#ifndef CPROFILESGSTONESPLUGINFILELISTSETTINGITEM_H
+#define CPROFILESGSTONESPLUGINFILELISTSETTINGITEM_H
+
+// INCLUDES
+#include <aknsettingitemlist.h>
+#include <cenrepnotifyhandler.h>
+
+// FORWARD DECLARATIONS
+class CCoeEnv;
+class CFLDFileListContainer;
+class CRepository;
+class MProfilesGSTonesPluginItemDataInterface;
+
+// CLASS DECLARATION
+/**
+*  Setting item class for tone selection.
+*  CProfilesGSTonesPluginFileListSettingItem launches File List Dialog common component
+*  from which user can select a file for ringing tone.
+*
+*  @lib ProfileSettingsView.lib
+*  @since 1.2
+*/
+NONSHARABLE_CLASS( CProfilesGSTonesPluginFileListSettingItem ) : public CAknSettingItem,
+    public MCenRepNotifyHandlerCallback
+	{
+
+	public:		// Constructors and destructor
+
+		/**
+		* C++ constructor.
+		* @param aIdentifier Resource identifier.
+		*        Tells which setting item is currently edited.
+		* @param aRingingType Describes how the tone is played.
+		* @param aRingingVolume The volume how loud the tone is played.
+		* @param aVibratingAlert Setting of the vibrating alert.
+		* @param aCoeEnv Pointer to Control Environment.
+		* @param aDataInterface reference to the interface to the data
+        *        storage.
+		*/
+		CProfilesGSTonesPluginFileListSettingItem(
+			TInt aIdentifier,
+            const TDesC& aDefaultToneFileName,
+			CCoeEnv* aCoeEnv,
+            MProfilesGSTonesPluginItemDataInterface& aDataInterface );
+
+        /**
+        * Destructor.
+        */
+		~CProfilesGSTonesPluginFileListSettingItem();
+
+	private:	// Functions from base classes
+
+        /**
+        * From CAknSettingItem
+        */
+		void CompleteConstructionL();
+
+        /**
+        * From CAknSettingItem
+        */
+		void StoreL();
+
+        /**
+        * From CAknSettingItem
+        */
+		void LoadL();
+
+        /**
+        * From CAknSettingItem
+        */
+		void EditItemL( TBool aCalledFromMenu );
+
+        /**
+        * From CAknSettingItem
+        */
+		const TDesC& SettingTextL();
+
+        /**
+        * From MCenRepNotifyHandlerCallback
+        */
+        void HandleNotifyInt( TUint32 aId, TInt aNewValue );
+        
+	private: // New functions
+	     /**
+         * Read the size limitation key from Profiles Central Repository.
+		 *
+		 * @param aRepository reference to an open Profiles Cenrep session.
+         */
+        void ReadMaxToneFileSizeL( CRepository& aRepository );
+
+	private:	// Data
+
+		// Internal buffer for filename of selected tone
+		TFileName iInternalToneFileName;
+
+		// Ringing type for tone playback
+		TInt iRingingType;
+
+		// Ringing volume for tone playback
+		TInt iRingingVolume;
+
+		// Vibrating alert setting for tone playback
+		TBool iVibratingAlert;
+
+		// Own: Localised text qtn_tc_none
+		HBufC* iNoSoundText;
+
+		// Own: "No_Sound.wav" file name
+		HBufC* iNoSoundFileName;
+
+		// Own: Localised text qtn_no_personal_tone
+		HBufC* iDefaultToneText;
+
+        // Default tone file name
+        TFileName iDefaultToneFileName;
+
+		// Own: Localised text for title for tone selection
+		HBufC* iTitle; /// Title for tone selection
+
+		// Text that is returned by SettingTextL
+		TPtrC iSettingText;
+
+		// Ref: Pointer to Control Environment
+		CCoeEnv* iCoeEnv;
+
+        // Own: File list container
+        CFLDFileListContainer* iFileListContainer;
+
+        // Own: Notification handler for active profile vibra setting
+        CCenRepNotifyHandler* iVibraNotifyHandler;
+
+        // Own: Notification handler for active profile ringing type setting
+        CCenRepNotifyHandler* iTypeNotifyHandler;
+
+        // Own: Notification handler for active profile ringing volume setting
+        CCenRepNotifyHandler* iVolumeNotifyHandler;
+
+        // Own: Profiles Central Repository session
+        CRepository* iSession;
+
+        // Own: Vibra control Central Repository session
+        CRepository* iVibraSession;
+
+        // The interface to the external data storage
+        MProfilesGSTonesPluginItemDataInterface& iDataInterface; 
+
+        // Holds the size limitation value for ringing tone file size
+        TInt iSizeLimit;
+	};
+
+#endif // CPROFILESGSTONESPLUGINFILELISTSETTINGITEM_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfilesGSTonesPlugin/src/CProfilesGSTonesPluginSettingsHandler.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,382 @@
+/*
+* 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:  Settings handler for the settings outside of Profiles.
+*
+*/
+
+
+
+// CLASS HEADER
+#include "CProfilesGSTonesPluginSettingsHandler.h"
+
+// INTERNAL INCLUDES
+#include "CProfilesGSTonesPluginFileListSettingItem.h"
+#include "ProfilesGSTonesPlugin.hrh"
+#include "ProfilesDebug.h"
+
+// INCLUDES FROM PROFILES SETTINGS VIEW
+#include <ProfilePanics.h>
+#include <ProfileSettingsView.hrh>
+#include <MProfileExternalSettingsObserver.h>
+
+// SYSTEM INCLUDES
+#include <centralrepository.h>
+#include <CalendarInternalCRKeys.h>
+#include <ClockDomainCRKeys.h>
+#include <ProfileEngineDomainCRKeys.h>
+#include <CoeHelp.h>
+#include <csxhelp/mode.hlp.hrh>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesPluginSettingsHandler::CProfilesGSTonesPluginSettingsHandler
+// C++ constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CProfilesGSTonesPluginSettingsHandler::CProfilesGSTonesPluginSettingsHandler(
+        CCoeEnv* aCoeEnv )
+    : iCoeEnv( aCoeEnv )
+    {
+    }
+
+// Destructor
+CProfilesGSTonesPluginSettingsHandler::~CProfilesGSTonesPluginSettingsHandler()
+    {
+    DrmDelete();
+	if( iClockNotifyHandler )
+		{
+		iClockNotifyHandler->StopListening();
+		}
+	if( iCalendarNotifyHandler )
+		{
+		iCalendarNotifyHandler->StopListening();
+		}
+
+    delete iClockNotifyHandler;
+    delete iCalendarNotifyHandler;
+
+    delete iClockSession;
+    delete iCalendarSession;
+    delete iCalendarInterface;
+    delete iClockInterface;
+
+    delete iTonesViewSettings;
+    delete iFeatures;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesPluginSettingsHandler::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CProfilesGSTonesPluginSettingsHandler::ConstructL()
+    {
+    PRODEBUG( "CProfilesGSTonesPluginSettingHandler::ConstructL begin" );
+    iFeatures = CProfilesGSTonesViewFeatures::NewL();
+    PRODEBUG( "CProfilesGSTonesPluginSettingHandler::ConstructL after features" );
+    iTonesViewSettings = CProfilesGSTonesViewSettings::NewL( *iFeatures );
+    PRODEBUG( "CProfilesGSTonesPluginSettingHandler::ConstructL after settings" );
+
+    iClockSession = CRepository::NewL( KCRUidClockApp );
+    iCalendarSession = CRepository::NewL( KCRUidCalendar );
+
+	iClockNotifyHandler = CCenRepNotifyHandler::NewL( *this,
+            *iClockSession,
+            CCenRepNotifyHandler::EStringKey,
+            KClockAppSoundFile );
+
+    iClockNotifyHandler->StartListeningL();
+
+	iCalendarNotifyHandler = CCenRepNotifyHandler::NewL( *this,
+            *iCalendarSession,
+            CCenRepNotifyHandler::EStringKey,
+            KCalendarSoundFile );
+
+    iCalendarNotifyHandler->StartListeningL();
+
+    User::LeaveIfError( iClockSession->Get( KClockAppSoundFile, iClockTone ) );
+    User::LeaveIfError( iCalendarSession->Get( KCalendarSoundFile,
+                                               iCalendarTone ) );
+    DrmConstructL();
+
+    iCalendarInterface =
+        new ( ELeave ) CProfilesGSTonesPluginCalendarDataInterface( *this );
+    iClockInterface =
+        new ( ELeave ) CProfilesGSTonesPluginClockDataInterface( *this );
+    PRODEBUG( "CProfilesGSTonesPluginSettingHandler::ConstructL end" );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesPluginSettingsHandler::NewL
+// -----------------------------------------------------------------------------
+//
+CProfilesGSTonesPluginSettingsHandler*
+        CProfilesGSTonesPluginSettingsHandler::NewL( CCoeEnv* aCoeEnv )
+    {
+    CProfilesGSTonesPluginSettingsHandler* self = new ( ELeave )
+        CProfilesGSTonesPluginSettingsHandler( aCoeEnv );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesPluginSettingsHandler::CreateSettingItemL
+// -----------------------------------------------------------------------------
+//
+CAknSettingItem* CProfilesGSTonesPluginSettingsHandler::CreateSettingItemL(
+        TInt aIdentifier )
+    {
+    PRODEBUG1( "CProfilesGSTonesPluginSettingHandler::CreateSettingItemL(%d) begin",aIdentifier );
+    TFileName defaultToneFile;
+    CAknSettingItem* item = NULL;
+
+    switch( aIdentifier )
+        {
+        case EProfileGSTonesPluginSettingCalendarToneId:
+            {
+            User::LeaveIfError( iCalendarSession->Get( KCalendarDefaultSoundFile,
+                                                       defaultToneFile ) );
+            item = new ( ELeave ) CProfilesGSTonesPluginFileListSettingItem(
+                   aIdentifier, defaultToneFile, iCoeEnv, *iCalendarInterface );
+            break;
+            }
+        case EProfileGSTonesPluginSettingClockToneId:
+            {
+            User::LeaveIfError( iClockSession->Get( KClockAppDefaultSoundFile,
+                                                    defaultToneFile ) );
+            item = new ( ELeave ) CProfilesGSTonesPluginFileListSettingItem(
+                   aIdentifier, defaultToneFile, iCoeEnv, *iClockInterface );
+                   
+            break;
+            }
+        case EProfileGSTonesPluginSettingHacModeId:
+            {
+            item = new( ELeave ) CAknBinaryPopupSettingItem(
+                aIdentifier, iTonesViewSettings->iHac );
+            break;
+            }
+        default:
+            {
+            User::Panic( KProfilePanicText, EProfilePanicInvalidSettingItemId );
+            break;
+            }
+        }
+
+    PRODEBUG1( "CProfilesGSTonesPluginSettingHandler::CreateSettingItemL(%d) end",aIdentifier );
+    return item;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesPluginSettingsHandler::SetObserver
+// -----------------------------------------------------------------------------
+//
+void CProfilesGSTonesPluginSettingsHandler::SetObserver(
+        MProfileExternalSettingsObserver& aObserver )
+    {
+    PRODEBUG( "CProfilesGSTonesPluginSettingHandler::SetObserver" );
+    iObserver = &aObserver;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesPluginSettingsHandler::AllowedToChange
+// -----------------------------------------------------------------------------
+//
+TBool CProfilesGSTonesPluginSettingsHandler::AllowedToChange(
+        TInt aSettingItemId ) const
+    {
+    switch( aSettingItemId )
+        {
+        case EProfileGSTonesPluginSettingCalendarToneId: // Fall through
+        case EProfileGSTonesPluginSettingClockToneId:
+            {
+            return ETrue;
+            }
+        case EProfileGSTonesPluginSettingHacModeId:
+            {
+            return ( iFeatures->IsLocalFeatureSupported(
+                     KTonesViewFeatureIdHac ) );
+            }
+        default:
+            {
+            return EFalse;
+            }
+        }
+    }
+    
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesPluginSettingsHandler::GetHelpContext
+// -----------------------------------------------------------------------------
+//
+TBool CProfilesGSTonesPluginSettingsHandler::GetHelpContext(
+        TCoeHelpContext& aContext ) const
+    {
+    aContext.iContext = KSET_HLP_PERSONAL_TONES;
+    return ETrue;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesPluginSettingsHandler::SetHiddenItems
+// -----------------------------------------------------------------------------
+//
+void CProfilesGSTonesPluginSettingsHandler::SetHiddenItems(
+        CAknSettingItemArray& aSettingItemArray ) const
+    {
+    PRODEBUG( "CProfilesGSTonesPluginSettingHandler::SetHiddenItems" );
+    TInt count( aSettingItemArray.Count() );
+    for( TInt index( 0 ); index < count; index++ )
+        {
+        CAknSettingItem* item = aSettingItemArray.At( index );
+        if( ( item->Identifier() == EProfileGSTonesPluginSettingHacModeId ) )
+            {
+            PRODEBUG( "CProfilesGSTonesPluginSettingHandler::SetHiddenItems hac" );
+            item->SetHidden(
+                !iFeatures->IsLocalFeatureSupported( KTonesViewFeatureIdHac ) );
+            }
+        }
+    PRODEBUG( "CProfilesGSTonesPluginSettingHandler::SetHiddenItems end" );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesPluginSettingsHandler::StoreIfChangedL
+// -----------------------------------------------------------------------------
+//
+void CProfilesGSTonesPluginSettingsHandler::StoreIfChangedL( TInt aSettingId )
+    {
+    PRODEBUG( "CProfilesGSTonesPluginSettingHandler::StoreIfChanged" );
+    iTonesViewSettings->StoreIfChangedL( aSettingId );
+    PRODEBUG( "CProfilesGSTonesPluginSettingHandler::StoreIfChanged end" );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesPluginSettingsHandler::HandleNotifyString
+// -----------------------------------------------------------------------------
+//
+void CProfilesGSTonesPluginSettingsHandler::HandleNotifyString( TUint32 aId,
+        const TDesC16& /* aNewValue */ )
+    {
+    PRODEBUG1( "CProfilesGSTonesPluginSettingHandler::HandleNotifyString(%d) begin",aId );
+    if( aId == KCalendarSoundFile )
+        { // cannot leave - ignore return value:
+        iCalendarSession->Get( KCalendarSoundFile, iCalendarTone );
+        }
+    else // Clock sound file
+        { // cannot leave - ignore return value:
+        iClockSession->Get( KClockAppSoundFile, iClockTone );
+        }
+    TRAP_IGNORE( iObserver->HandleExternalSettingsChangedL() );
+    PRODEBUG1( "CProfilesGSTonesPluginSettingHandler::HandleNotifyString(%d) end",aId );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesPluginSettingsHandler::StoreCalendarToneL
+// -----------------------------------------------------------------------------
+//
+void CProfilesGSTonesPluginSettingsHandler::StoreCalendarToneL(
+        const TDesC& aTone )
+    {
+    PRODEBUG1( "CProfilesGSTonesPluginSettingHandler::StoreCalendarTone(%S)",&aTone );
+    if( iCalendarTone.CompareF( aTone ) != 0 )
+        {
+        User::LeaveIfError(
+                iCalendarSession->Set( KCalendarSoundFile, aTone ) );
+        RemoveAutomatedContent( iCalendarTone );
+        iCalendarTone.Copy( aTone );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesPluginSettingsHandler::StoreClockToneL
+// -----------------------------------------------------------------------------
+//
+void CProfilesGSTonesPluginSettingsHandler::StoreClockToneL(
+        const TDesC& aTone )
+    {
+    PRODEBUG1( "CProfilesGSTonesPluginSettingHandler::StoreClockTone(%S)",&aTone );
+    if( iClockTone.CompareF( aTone ) != 0 )
+        {
+        User::LeaveIfError(
+                iClockSession->Set( KClockAppSoundFile, aTone ) );
+        RemoveAutomatedContent( iClockTone );
+        iClockTone.Copy( aTone );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesPluginCalendarDataInterface::
+// CProfilesGSTonesPluginCalendarDataInterface
+// -----------------------------------------------------------------------------
+//
+CProfilesGSTonesPluginCalendarDataInterface::
+CProfilesGSTonesPluginCalendarDataInterface(
+        CProfilesGSTonesPluginSettingsHandler& aSettingsHandler )
+    : iSettingsHandler( aSettingsHandler )
+    {}
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesPluginCalendarDataInterface::ItemData
+// -----------------------------------------------------------------------------
+//
+const TDesC& CProfilesGSTonesPluginCalendarDataInterface::ItemData()
+    {
+    return iSettingsHandler.iCalendarTone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesPluginCalendarDataInterface::SetItemDataL
+// -----------------------------------------------------------------------------
+//
+void CProfilesGSTonesPluginCalendarDataInterface::SetItemDataL(
+        const TDesC& aDataBuf )
+    {
+    PRODEBUG( "CProfilesGSTonesPluginCalendarDataInterface::SetItemDataL" );
+    iSettingsHandler.StoreCalendarToneL( aDataBuf );
+    PRODEBUG( "CProfilesGSTonesPluginCalendarDataInterface::SetItemDataL end" );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesPluginClockDataInterface::
+// CProfilesGSTonesPluginClockDataInterface
+// -----------------------------------------------------------------------------
+//
+CProfilesGSTonesPluginClockDataInterface::
+CProfilesGSTonesPluginClockDataInterface(
+        CProfilesGSTonesPluginSettingsHandler& aSettingsHandler )
+    : iSettingsHandler( aSettingsHandler )
+    {}
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesPluginClockDataInterface::ItemData
+// -----------------------------------------------------------------------------
+//
+const TDesC& CProfilesGSTonesPluginClockDataInterface::ItemData()
+    {
+    return iSettingsHandler.iClockTone;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesPluginClockDataInterface::SetItemDataL
+// -----------------------------------------------------------------------------
+//
+void CProfilesGSTonesPluginClockDataInterface::SetItemDataL(
+        const TDesC& aDataBuf )
+    {
+    PRODEBUG( "CProfilesGSTonesPluginClockDataInterface::SetItemDataL" );
+    iSettingsHandler.StoreClockToneL( aDataBuf );
+    PRODEBUG( "CProfilesGSTonesPluginClockDataInterface::SetItemDataL end" );
+    }
+
+// End Of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfilesGSTonesPlugin/src/CProfilesGSTonesPluginSettingsHandler.h	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,271 @@
+/*
+* 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:  Settings handler for the settings outside of Profiles.
+*
+*/
+
+
+
+#ifndef CPROFILESGSTONESPLUGINSETTINGSHANDLER_H
+#define CPROFILESGSTONESPLUGINSETTINGSHANDLER_H
+
+// INCLUDES
+#include <e32base.h>
+#include <cenrepnotifyhandler.h>
+#include <MProfileExternalSettingsHandler.h>
+#include "MProfilesGSTonesPluginItemDataInterface.h"
+#include "CProfilesGSTonesViewFeatures.h"
+#include "CProfilesGSTonesViewSettings.h"
+
+// FORWARD DECLARATIONS
+class CCoeEnv;
+class CRepository;
+class MProfileExternalSettingsObserver;
+class CDRMHelper;
+class CProfilesGSTonesPluginCalendarDataInterface;
+class CProfilesGSTonesPluginClockDataInterface;
+class TCoeHelpContext;
+
+// CLASS DECLARATION
+/**
+*  Setting item class for tone selection.
+*  CProfilesGSTonesPluginSettingsHandler launches File List Dialog common component
+*  from which user can select a file for ringing tone.
+*
+*  @lib ProfileSettingsView.lib
+*  @since 1.2
+*/
+NONSHARABLE_CLASS( CProfilesGSTonesPluginSettingsHandler )
+    : public CBase,
+      public MCenRepNotifyHandlerCallback,
+      public MProfileExternalSettingsHandler
+	{
+
+    friend class CProfilesGSTonesPluginCalendarDataInterface; // CSI: 36 # This friend is defined in this very same file
+    friend class CProfilesGSTonesPluginClockDataInterface; // CSI: 36 # This friend is defined in this very same file
+
+	public:		// Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CProfilesGSTonesPluginSettingsHandler* NewL( CCoeEnv* aCoeEnv );
+
+        /**
+        * Destructor.
+        */
+		~CProfilesGSTonesPluginSettingsHandler();
+
+        /**
+        * Variated destructor.
+        */
+        void DrmDelete();
+
+	private:	// Functions from base classes
+
+        /**
+        * From MCenRepNotifyHandlerCallback
+        */
+        void HandleNotifyString( TUint32 aId, const TDesC16& aNewValue );
+        
+        /**
+        * From MProfilesExternalSettingsHandler
+        */
+		CAknSettingItem* CreateSettingItemL( TInt aIdentifier );
+
+        /**
+        * From MProfilesExternalSettingsHandler
+        */
+		void SetObserver(
+                MProfileExternalSettingsObserver& aObserver );
+
+        /**
+        * From MProfilesExternalSettingsHandler
+        */
+        TBool AllowedToChange( TInt aSettingItemId ) const;
+
+        /**
+        * From MProfilesExternalSettingsHandler
+        */
+        TBool GetHelpContext( TCoeHelpContext& aContext ) const;
+
+        /**
+        * From MProfilesExternalSettingsHandler
+        */
+        void SetHiddenItems( CAknSettingItemArray& aSettingItemArray ) const;
+             
+        /**
+        * From MProfilesExternalSettingsHandler
+        */
+        void StoreIfChangedL( TInt aSettingId );
+
+    protected:
+
+        /**
+        * C++ constructor.
+        */
+		CProfilesGSTonesPluginSettingsHandler( CCoeEnv* aCoeEnv );
+
+        /**
+        * Symbian 2nd phase constructor.
+        */
+        void ConstructL();
+
+        /**
+        * Variated constructor.
+        */
+        void DrmConstructL();
+
+	private:	// New functions 
+
+        /**
+        * Stores the new Calendar alarm tone in the Central Repository.
+        * @param aTone the file to be used as the new Calendar alarm tone.
+        */
+        void StoreCalendarToneL( const TDesC& aTone );
+
+        /**
+        * Stores the new Clock alarm tone in the Central Repository.
+        * @param aTone the file to be used as the new Clock alarm tone.
+        */
+        void StoreClockToneL( const TDesC& aTone );
+
+        /**
+        * Removes the given tone from the list of automated content.
+        * @param aOldTone tone to be removed from the automated content list.
+        */
+        void RemoveAutomatedContent( const TDesC& aOldTone );
+
+	private:	// Data 
+
+        /// Ref: Observer for the settings controlled by this handler
+        MProfileExternalSettingsObserver* iObserver;
+
+		/// Own: Pointer to Central Repository of Clock App
+        CRepository* iClockSession;
+
+		/// Own: Pointer to Central Repository of Calendar App
+        CRepository* iCalendarSession;
+
+		/// Own: Pointer to clock alert tone notify handler
+		CCenRepNotifyHandler* iClockNotifyHandler;
+
+		/// Own: Pointer to calendar alert tone notify handler
+		CCenRepNotifyHandler* iCalendarNotifyHandler;
+
+        /// Current Clock alert tone
+        TFileName iClockTone;
+
+        /// Current Calendar alert tone
+        TFileName iCalendarTone;
+
+        /// Ref: Pointer to the control environment
+        CCoeEnv* iCoeEnv;
+
+        /// Own: Interface for File list setting item for calendar tone
+        CProfilesGSTonesPluginCalendarDataInterface* iCalendarInterface;
+        
+        /// Own: Interface for File list setting item for clock tone
+        CProfilesGSTonesPluginClockDataInterface* iClockInterface;
+
+        /// Own: Drm helper for removing automated content when needed:
+        CDRMHelper* iDrmHelper;
+
+        /// Own: The variable features of Tones View
+        CProfilesGSTonesViewFeatures* iFeatures;
+
+        /// Own: The settings only in Tones View
+        CProfilesGSTonesViewSettings* iTonesViewSettings;
+	};
+
+// This friend class of CProfilesGSTonesPluginSettingsHandler provides the
+// interface for the setting item to actually load and store the Calendar
+// alert tone name to the handler above.
+NONSHARABLE_CLASS( CProfilesGSTonesPluginCalendarDataInterface )
+    : public CBase,
+      public MProfilesGSTonesPluginItemDataInterface
+	{
+	public:		// Constructors and destructor
+
+        /**
+		* C++ constructor.
+        */
+        CProfilesGSTonesPluginCalendarDataInterface(
+                CProfilesGSTonesPluginSettingsHandler& aSettingsHandler );
+
+        /**
+        * Destructor.
+        */
+		~CProfilesGSTonesPluginCalendarDataInterface() {};
+
+	private:	// Functions from base classes
+
+        /**
+        * From MProfilesGSTonesPluginItemDataInterface
+        */
+		virtual const TDesC& ItemData();
+
+        /**
+        * From MProfilesGSTonesPluginItemDataInterface
+        */
+		virtual void SetItemDataL( const TDesC& aDataBuf );
+
+	private:	// Data
+
+        /// Settings handler containing the setting to be controlled
+        CProfilesGSTonesPluginSettingsHandler& iSettingsHandler;
+	};
+
+// This friend class of CProfilesGSTonesPluginSettingsHandler provides the
+// interface for the setting item to actually load and store the Clock
+// alert tone name to the handler above.
+NONSHARABLE_CLASS( CProfilesGSTonesPluginClockDataInterface )
+    : public CBase,
+      public MProfilesGSTonesPluginItemDataInterface
+	{
+	public:		// Constructors and destructor
+
+        /**
+		* C++ constructor.
+        */
+        CProfilesGSTonesPluginClockDataInterface(
+                CProfilesGSTonesPluginSettingsHandler& aSettingsHandler );
+
+        /**
+        * Destructor.
+        */
+		~CProfilesGSTonesPluginClockDataInterface() {};
+
+	private:	// Functions from base classes
+
+        /**
+        * From MProfilesGSTonesPluginItemDataInterface
+        */
+		virtual const TDesC& ItemData();
+
+        /**
+        * From MProfilesGSTonesPluginItemDataInterface
+        */
+		virtual void SetItemDataL( const TDesC& aDataBuf );
+
+	private:	// Data
+
+        /// Settings handler containing the setting to be controlled
+        CProfilesGSTonesPluginSettingsHandler& iSettingsHandler;
+	};
+
+#endif // CPROFILESGSTONESPLUGINSETTINGSHANDLER_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfilesGSTonesPlugin/src/CProfilesGSTonesPluginSettingsHandlerDrmEmpty.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  Settings handler for the settings outside of Profiles.
+*
+*/
+
+
+
+// CLASS HEADER
+#include "CProfilesGSTonesPluginSettingsHandler.h"
+
+#include <DRMHelper.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesPluginSettingsHandler::RemoveAutomatedContent
+// -----------------------------------------------------------------------------
+//
+void CProfilesGSTonesPluginSettingsHandler::RemoveAutomatedContent(
+        const TDesC& aOldTone )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesPluginSettingsHandler::DrmConstructL
+// -----------------------------------------------------------------------------
+//
+void CProfilesGSTonesPluginSettingsHandler::DrmConstructL()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesPluginSettingsHandler::DrmDelete
+// -----------------------------------------------------------------------------
+//
+void CProfilesGSTonesPluginSettingsHandler::DrmDelete()
+    {
+    }
+
+// End Of File
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfilesGSTonesPlugin/src/CProfilesGSTonesPluginSettingsHandlerDrmFull.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,57 @@
+/*
+* 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:  Settings handler for the settings outside of Profiles.
+*
+*/
+
+
+
+// CLASS HEADER
+#include "CProfilesGSTonesPluginSettingsHandler.h"
+
+#include <DRMHelper.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesPluginSettingsHandler::RemoveAutomatedContent
+// -----------------------------------------------------------------------------
+//
+void CProfilesGSTonesPluginSettingsHandler::RemoveAutomatedContent(
+        const TDesC& aOldTone )
+    {
+    iDrmHelper->RemoveAutomatedPassive( aOldTone ); // ignore return value
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesPluginSettingsHandler::DrmConstructL
+// -----------------------------------------------------------------------------
+//
+void CProfilesGSTonesPluginSettingsHandler::DrmConstructL()
+    {
+    iDrmHelper = CDRMHelper::NewL( *iCoeEnv );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesPluginSettingsHandler::DrmDelete
+// -----------------------------------------------------------------------------
+//
+void CProfilesGSTonesPluginSettingsHandler::DrmDelete()
+    {
+    delete iDrmHelper;
+    iDrmHelper = NULL;
+    }
+
+// End Of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfilesGSTonesPlugin/src/CProfilesGSTonesViewFeatures.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,86 @@
+/*
+* 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:  Wraps the information about variable features of GS Tones
+*                View.
+*
+*/
+
+
+
+// CLASS HEADER
+#include "CProfilesGSTonesViewFeatures.h"
+
+// INTERNAL INCLUDES
+#include "ProfilesDebug.h"
+
+// SYSTEM INCLUDES
+#include <centralrepository.h>
+#include <ProfileEngineDomainCRKeys.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// Destructor
+CProfilesGSTonesViewFeatures::~CProfilesGSTonesViewFeatures()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesViewFeatures::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CProfilesGSTonesViewFeatures::ConstructL()
+    {
+    PRODEBUG( "CProfilesGSTonesViewFeatures::ConstructL begin" );
+    CRepository* profilesLVSession = CRepository::NewLC( KCRUidProfilesLV );
+    TInt error( profilesLVSession->Get( KProEngTonesViewLVFlags,
+                                        iLocalFeatures ) );
+    // If the key isn't found, all the local features are disabled:
+    if( error && ( error != KErrNotFound ) )
+        {
+        User::Leave( error );
+        }
+
+    CleanupStack::PopAndDestroy( profilesLVSession );
+    PRODEBUG( "CProfilesGSTonesViewFeatures::ConstructL end" );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesViewFeatures::NewL
+// -----------------------------------------------------------------------------
+//
+CProfilesGSTonesViewFeatures*
+        CProfilesGSTonesViewFeatures::NewL()
+    {
+    CProfilesGSTonesViewFeatures* self = new ( ELeave )
+        CProfilesGSTonesViewFeatures();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesViewFeatures::IsLocalFeatureSupported
+// -----------------------------------------------------------------------------
+//
+TBool CProfilesGSTonesViewFeatures::IsLocalFeatureSupported(
+        TUint32 aFeatureId ) const
+    {
+    return ( iLocalFeatures & aFeatureId );
+    }
+
+// End Of File
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfilesGSTonesPlugin/src/CProfilesGSTonesViewFeatures.h	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,80 @@
+/*
+* 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:  Wraps  the information about variable features of GS Tones
+*                View.
+*
+*/
+
+
+
+#ifndef CPROFILESGSTONESVIEWFEATURES_H
+#define CPROFILESGSTONESVIEWFEATURES_H
+
+// INCLUDES
+#include <e32base.h>
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+/**
+* Contains the information about variated features of GS Tones View.
+*
+*  @lib ProfilesGSTonesPlugin.lib
+*  @since 3.1
+*/
+NONSHARABLE_CLASS( CProfilesGSTonesViewFeatures ) : public CBase
+    {
+    public:     // Constructor and destructor
+
+        static CProfilesGSTonesViewFeatures* NewL();
+
+        /**
+        * Destructor.
+        */
+        ~CProfilesGSTonesViewFeatures();
+
+    public:     // New functions
+
+        /**
+        * Checks if the given locally variated feature is enabled.
+        * @param aFeatureId the feature id Tones view features as specified in
+        *        ProfileEngineDomainCRKeys.h
+        * @return ETrue is the given feature is supported, false otherwise.
+        */
+        TBool IsLocalFeatureSupported( TUint32 aFeatureId ) const;
+
+    private:     // constructors
+        /**
+        * C++ default constructor.
+        */
+        CProfilesGSTonesViewFeatures() {};
+
+        /**
+         * Symbian constructor.
+         */
+        void ConstructL();
+
+    private:     // Data
+
+        // Local features of Tones View
+        TInt iLocalFeatures;
+
+    };
+
+#endif // CPROFILESGSTONESVIEWFEATURES_H
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfilesGSTonesPlugin/src/CProfilesGSTonesViewSettings.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,96 @@
+/*
+* 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:  Data structure class for profile tones view settings.
+*
+*/
+
+
+
+// CLASS HEADER
+#include "CProfilesGSTonesViewSettings.h"
+
+// INTERNAL INCLUDES
+#include "ProfilesGSTonesPlugin.hrh"
+#include "ProfilesDebug.h"
+#include "CProfilesGSTonesViewFeatures.h"
+
+// INCLUDES FROM PROFILES SETTINGS VIEW
+
+// SYSTEM INCLUDES
+#include <centralrepository.h>
+#include <HWRMDomainCRKeys.h>
+#include <ProfileEngineDomainCRKeys.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// Destructor
+CProfilesGSTonesViewSettings::~CProfilesGSTonesViewSettings()
+    {
+    delete iHwRmSession;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesViewSettings::ConstructL
+// -----------------------------------------------------------------------------
+//
+void CProfilesGSTonesViewSettings::ConstructL()
+    {
+    PRODEBUG( "CProfilesGSTonesPluginSettingHandler::ConstructL begin" );
+    if( iFeatures.IsLocalFeatureSupported( KTonesViewFeatureIdHac ) )
+        {
+        iHwRmSession = CRepository::NewL( KCRUidHWSettings );
+        User::LeaveIfError( iHwRmSession->Get( KHWSettingsHearingAidMode, iHac ) );
+        }
+    PRODEBUG( "CProfilesGSTonesPluginSettingHandler::ConstructL end" );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesViewSettings::NewL
+// -----------------------------------------------------------------------------
+//
+CProfilesGSTonesViewSettings* CProfilesGSTonesViewSettings::NewL(
+        CProfilesGSTonesViewFeatures& aFeatures )
+       
+    {
+    CProfilesGSTonesViewSettings* self = new ( ELeave )
+        CProfilesGSTonesViewSettings( aFeatures );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesViewSettings::StoreIfChangedL
+// -----------------------------------------------------------------------------
+//
+void CProfilesGSTonesViewSettings::StoreIfChangedL( TInt aSettingId ) const
+    {
+    if( ( aSettingId == EProfileGSTonesPluginSettingHacModeId ) &&
+        iFeatures.IsLocalFeatureSupported( KTonesViewFeatureIdHac ) )
+        {
+        TInt currentValue( 0 );
+        User::LeaveIfError( iHwRmSession->Get( KHWSettingsHearingAidMode,
+                                             currentValue ) );
+        if( currentValue != iHac )
+            {
+            User::LeaveIfError( iHwRmSession->Set( KHWSettingsHearingAidMode,
+                                                 iHac ) );
+            currentValue = iHac;
+            }
+        }
+    }
+
+// End Of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfilesGSTonesPlugin/src/CProfilesGSTonesViewSettings.h	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,93 @@
+/*
+* 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:  Data structure class for profile tones view settings.
+*
+*/
+
+
+
+#ifndef CPROFILESGSTONESVIEWSETTINGS_H
+#define CPROFILESGSTONESVIEWSETTINGS_H
+
+// INCLUDES
+#include <e32base.h>
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class CProfilesGSTonesViewFeatures;
+class CRepository;
+
+// CLASS DECLARATION
+/**
+*  Data structure class for Profile GS Tones View settings. Contains only  the
+*  settings not found in Profiles Personalization view. However, Calendar
+*  and Clock alert tones are not handled by this class.
+*
+*  @lib ProfilesGSTonesPlugin.lib
+*  @since 3.1
+*/
+NONSHARABLE_CLASS( CProfilesGSTonesViewSettings ) : public CBase
+    {
+    public:     // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CProfilesGSTonesViewSettings* NewL(
+                CProfilesGSTonesViewFeatures& aFeatures );
+
+        /**
+        * Destructor.
+        */
+        ~CProfilesGSTonesViewSettings();
+
+    public:     // New functions
+
+        /**
+        * Stores the value of the given setting to persistent memory if the
+        * value has been changed (from that found from persistent storage).
+        * @param aSettingId the ID of the setting (as defined in resources) to
+        *        be checked.
+        */
+        void StoreIfChangedL( TInt aSettingId ) const;
+
+    private:
+        /**
+        * C++ constructor.
+        */
+        CProfilesGSTonesViewSettings( CProfilesGSTonesViewFeatures& aFeatures )
+            : iFeatures( aFeatures ) {};
+
+        /**
+        * Symbian constructor.
+        */
+        void ConstructL();
+
+    public:     // Data
+
+        // HAC setting
+        TBool iHac;
+
+        // HW Resource Manager central repository
+        // Note, this is NULL if HAC is not supported:
+        CRepository* iHwRmSession;
+
+        // Reference to the variable features wrapper
+        CProfilesGSTonesViewFeatures& iFeatures;
+    };
+
+#endif // CPROFILESGSTONESVIEWSETTINGS_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfilesGSTonesPlugin/src/MProfilesGSTonesPluginItemDataInterface.h	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,57 @@
+/*
+* 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 to the actual storage used for saving the data.
+*
+*/
+
+
+
+#ifndef MPROFILESGSTONESPLUGINITEMDATAINTERFACE_H
+#define MPROFILESGSTONESPLUGINITEMDATAINTERFACE_H
+
+//  INCLUDES
+#include <e32std.h>
+
+// CLASS DECLARATION
+
+/**
+*  Interface to the actual storage used for saving the data.
+*
+*  @lib ProfilesGSTonesPlugin.dll
+*  @since 3.1
+*/
+class MProfilesGSTonesPluginItemDataInterface
+    {
+
+    public: // New functions
+
+        /**
+        * Returns the data currently saved in the storage.
+        * @return the data currently saved in the storage.
+        */
+		virtual const TDesC& ItemData() = 0;
+
+        /**
+        * Sets the data in the storage.
+        * @param aDataBuf contains the data to be saved.
+        */
+		virtual void SetItemDataL( const TDesC& aDataBuf ) = 0;
+
+    };
+
+#endif      // MPROFILESGSTONESPLUGINITEMDATAINTERFACE_H
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfilesGSTonesPlugin/src/ProfilesGSTonesPlugin.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,393 @@
+/*
+* 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 "ProfilesGSTonesPlugin.h"
+
+#include "ProfilesUID.h"
+#include "CProfilesGSTonesPluginSettingsHandler.h"
+#include "ProfilesDebug.h"
+#include "ProfilesGSTonesPlugin.hrh"
+#include <profilesgstonespluginrsc.rsg>
+#include <CProfileNaviPaneContainer.h>
+
+// Includes from Profiles Settings View:
+#include <CProfileSettingsContainer.h>
+#include <CProfileEngineHandler.h>
+
+// Includes from Profiles Engine:
+#include <MProfileEngineExtended.h>
+#include <MProfilesLocalFeatures.h>
+#include <CProfileChangeNotifyHandler.h>
+#include "ProfilesVariant.hrh"
+
+// Includes from GS framework:
+#include <GSFWViewUIDs.h>
+#include <GSPrivatePluginProviderIds.h>
+
+// External includes
+#include <StringLoader.h>
+#include <bautils.h>
+#include <f32file.h>
+#include <data_caging_path_literals.hrh>
+#include <FeatMgr.h>
+#include <hlplch.h>
+#include <akntitle.h>
+#include <aknglobalnote.h>
+
+class CProfileIndexHandler;
+class CProfileTabHandler;
+
+namespace {
+// Constants
+    const TUid KProfilesGSTonesPluginUid =
+        { IMPLEMENTATION_UID_PROFILES_GS_TONES_PLUGIN };
+
+    _LIT( KProfilesGSTonesPluginResourceFileName,
+          "z:ProfilesGSTonesPluginRsc.rsc" );
+}
+
+// CLASS DECLARATION
+
+
+/******************************************************************************
+ * class CProfileGSTonesTopControl
+ ******************************************************************************/
+
+
+CProfileGSTonesTopControl* CProfileGSTonesTopControl::NewL( CCoeControl* aFocusControl )
+    {
+    CProfileGSTonesTopControl* self = new ( ELeave ) CProfileGSTonesTopControl();
+    self->iFocusControl = aFocusControl;
+    return self;
+    }
+
+void CProfileGSTonesTopControl::FocusChanged( TDrawNow aDrawNow )
+    {
+    // Not calling super::FocusChanged is intentional
+    if( iFocusControl )
+        {
+        iFocusControl->SetFocus( IsFocused(), aDrawNow );
+        }
+    }
+
+
+/******************************************************************************
+ * class CProfilesGSTonesPlugin
+ ******************************************************************************/
+
+
+
+// ---------------------------------------------------------------------------
+// CProfilesGSTonesPlugin::CProfilesGSTonesPlugin()
+// ---------------------------------------------------------------------------
+//
+CProfilesGSTonesPlugin::CProfilesGSTonesPlugin()
+    : iResourceLoader( *iCoeEnv )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// CProfilesGSTonesPlugin::~CProfilesGSTonesPlugin()
+// ---------------------------------------------------------------------------
+//
+CProfilesGSTonesPlugin::~CProfilesGSTonesPlugin()
+    {
+    DoDeactivate();
+    delete iEngineHandler;
+    iResourceLoader.Close();
+    delete iNotifier;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CProfilesGSTonesPlugin::ConstructL()
+// ---------------------------------------------------------------------------
+//
+void CProfilesGSTonesPlugin::ConstructL()
+    {
+    PRODEBUG( "CProfilesGSTonesPlugin::ConstructL() begin" );
+    // Find the resource file
+    TParse parse;
+    parse.Set( KProfilesGSTonesPluginResourceFileName, 
+               &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 );
+    
+    PRODEBUG( "CProfilesGSTonesPlugin::ConstructL() before BaseConstructL call" );
+    BaseConstructL( R_PROFILES_GS_TONES_VIEW ); // CSI: 9 # The resource file must be opened before this call
+
+    iNotifier = CProfileChangeNotifyHandler::NewL( this );
+    iEngineHandler = CProfileEngineHandler::NewL();
+    iPreviousProfile = iEngineHandler->Engine()->ActiveProfileId();
+    PRODEBUG( "CProfilesGSTonesPlugin::ConstructL() end" );
+    }
+
+
+// ---------------------------------------------------------------------------
+// CProfilesGSTonesPlugin::NewL()
+// ---------------------------------------------------------------------------
+//
+CProfilesGSTonesPlugin* CProfilesGSTonesPlugin::NewL( TAny* /*aInitParams*/ )
+	{
+	CProfilesGSTonesPlugin* self = new(ELeave) CProfilesGSTonesPlugin();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::Id()
+// ---------------------------------------------------------------------------
+//
+TUid CProfilesGSTonesPlugin::Id() const
+    {
+    PRODEBUG( "CProfilesGSTonesPlugin::Id" );
+    return KProfilesGSTonesPluginUid;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::DoActivateL()
+// ---------------------------------------------------------------------------
+//
+void CProfilesGSTonesPlugin::DoActivateL
+    ( const TVwsViewId& /* aPrevViewId */,
+      TUid /* aCustomMessageId */,
+      const TDesC8& /* aCustomMessage */ )
+    {
+    PRODEBUG( "CProfilesGSTonesPlugin::DoActivateL begin" );
+    if ( !iContainer )
+        {
+        iSettingsHandler =
+            CProfilesGSTonesPluginSettingsHandler::NewL( iCoeEnv );
+
+        iContainer = CProfileSettingsContainer::NewL(
+            *this, *iEngineHandler, *iSettingsHandler, (CProfileIndexHandler*) NULL,
+            (CProfileTabHandler*) NULL, (CAknTitlePane*) NULL,
+            R_PROFILE_GS_TONES_VIEW_SETTING_ITEM_LIST );
+
+        iTopControl = CProfileGSTonesTopControl::NewL( iContainer );
+
+        // Set the title pane text
+       	CAknTitlePane* titlePane = static_cast< CAknTitlePane* >(
+		    StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
+        HBufC* title = StringLoader::LoadLC( R_PROFILES_GS_TONES_VIEW_TITLE );
+        titlePane->SetTextL( *title );
+        CleanupStack::PopAndDestroy( title );
+
+        iNaviPaneContainer =
+            CProfileNaviPaneContainer::NewL( *StatusPane(), *iEngineHandler );
+        // Set the name of the active profile to navi pane
+        iNaviPaneContainer->SetNaviPaneTextL();
+
+        AppUi()->AddToViewStackL( *this, iContainer );
+        // Top control is always on top as it listens to focus changes (which
+        // will be routed to container to adapt highlight animation to focus)
+        AppUi()->AddToStackL( *this, iTopControl );
+
+        iContainer->MakeVisible( ETrue );
+        }
+    PRODEBUG( "CProfilesGSTonesPlugin::DoActivateL end" );
+    }
+
+// ---------------------------------------------------------------------------
+// CGSParentPlugin::DoDeactivate()
+// ---------------------------------------------------------------------------
+//
+void CProfilesGSTonesPlugin::DoDeactivate()
+    {
+    PRODEBUG( "CProfilesGSTonesPlugin::DoDeactivateL begin" );
+    delete iNaviPaneContainer;
+    iNaviPaneContainer = NULL;
+
+    if ( iTopControl )
+        {
+        AppUi()->RemoveFromStack( iTopControl );
+        delete iTopControl;
+        iTopControl = NULL;
+        }
+    if ( iContainer )
+        {
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+    delete iSettingsHandler;
+    iSettingsHandler = NULL;
+    PRODEBUG( "CProfilesGSTonesPlugin::DoDeactivateL end" );
+    }
+
+// ----------------------------------------------------------------------------
+// CProfilesGSTonesPlugin::HandleCommandL
+// 
+// Handles commands directed to this class.
+// ----------------------------------------------------------------------------
+void CProfilesGSTonesPlugin::HandleCommandL( TInt aCommand )
+    {   
+    PRODEBUG1( "CProfilesGSTonesPlugin::HandleCommandL(%d) begin", aCommand );
+    CAknViewAppUi* appUi = AppUi();
+    switch ( aCommand )
+        {
+        case EAknSoftkeyBack:
+            appUi->ActivateLocalViewL( KGSPrslnPluginUid ); 
+            break;
+        case EProfilesGsTonesCmdChange:
+        case EAknSoftkeyChange:
+            PRODEBUG( "CProfilesGSTonesPlugin::HandleCommandL before EditItemL" );
+            iContainer->EditItemL(
+                iContainer->SettingItemArray()->ItemIndexFromVisibleIndex(
+                    iContainer->ListBox()->CurrentItemIndex() ),
+                    ( aCommand == EProfilesGsTonesCmdChange ) );
+            PRODEBUG( "CProfilesGSTonesPlugin::HandleCommandL after EditItemL" );
+            break;
+        case EAknCmdHelp:
+            {
+            if( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+                {
+                HlpLauncher::LaunchHelpApplicationL(
+                    iEikonEnv->WsSession(), appUi->AppHelpContextL() );
+                }
+            break;
+            }
+        default:
+            appUi->HandleCommandL( aCommand );
+            break;
+        }
+    PRODEBUG( "CProfilesGSTonesPlugin::HandleCommandL end" );
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesPlugin::DynInitMenuPaneL
+// -----------------------------------------------------------------------------
+//
+void CProfilesGSTonesPlugin::DynInitMenuPaneL(
+    TInt aResourceId, CEikMenuPane* aMenuPane )
+	{
+	if( aResourceId == R_PROFILES_GS_OPTIONS_MENUPANE )
+		{
+		if( !FeatureManager::FeatureSupported( KFeatureIdHelp ) )
+			{
+			// Help is not supported. Hide Help from Options menu
+			aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue );
+			}
+		}
+	}
+
+// ========================= From CGSPluginInterface ==================
+
+
+// ---------------------------------------------------------------------------
+// CProfilesGSTonesPlugin::GetCaptionL()
+// ---------------------------------------------------------------------------
+//
+void CProfilesGSTonesPlugin::GetCaptionL( TDes& aCaption ) const
+    {
+    PRODEBUG( "CProfilesGSTonesPlugin::GetCaptionL begin" );
+    // The resource file is already opened by iResourceLoader.
+    HBufC* result = StringLoader::LoadL( R_PROFILES_GS_TONES_VIEW_CAPTION );
+    aCaption.Copy( *result );
+    delete result;
+    PRODEBUG( "CProfilesGSTonesPlugin::GetCaptionL end" );
+    }
+
+// ---------------------------------------------------------------------------
+// CProfilesGSTonesPlugin::PluginProviderCategory()
+// ---------------------------------------------------------------------------
+//
+TInt CProfilesGSTonesPlugin::PluginProviderCategory() const
+    {
+    PRODEBUG( "CProfilesGSTonesPlugin::PluginProviderCategory" );
+    return KGSPluginProviderInternal;
+    }
+
+// ---------------------------------------------------------------------------
+// CProfilesGSTonesPlugin::ItemType()
+// ---------------------------------------------------------------------------
+//
+TGSListboxItemTypes CProfilesGSTonesPlugin::ItemType()
+    {
+    PRODEBUG( "CProfilesGSTonesPlugin::ItemType" );
+    return EGSItemTypeSetting;
+    }
+
+// ---------------------------------------------------------------------------
+// CProfilesGSTonesPlugin::UpdateClientRect()
+// ---------------------------------------------------------------------------
+//
+void CProfilesGSTonesPlugin::UpdateClientRect()
+    {
+    PRODEBUG( "CProfilesGSTonesPlugin::UpdateClientRect" );
+	iContainer->SetRect( ClientRect() );
+    }
+
+// ---------------------------------------------------------------------------
+// CProfilesGSTonesPlugin::View()
+// ---------------------------------------------------------------------------
+//
+CAknView& CProfilesGSTonesPlugin::View()
+    {
+    PRODEBUG( "CProfilesGSTonesPlugin::View" );
+    return *this;
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesPlugin::HandleActiveProfileEventL
+// -----------------------------------------------------------------------------
+//
+void CProfilesGSTonesPlugin::HandleActiveProfileEventL(
+    TProfileEvent aProfileEvent, TInt aProfileId )
+    {
+    PRODEBUG( "CProfilesGSTonesPlugin::HandleActiveProfileEventL" );
+    if( ( aProfileEvent == EProfileNewActiveProfile ) &&
+        ( aProfileId != iPreviousProfile ) &&
+        iNaviPaneContainer )
+        {
+        // Active profile has changed. Change active profile name in navi pane.
+        iNaviPaneContainer->SetNaviPaneTextL();
+        ShowInfoNoteL( R_PROFILES_GS_TONES_VIEW_UPDATED_NOTE );
+        iPreviousProfile = aProfileId;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CProfilesGSTonesPlugin::ShowInfoNoteL
+// -----------------------------------------------------------------------------
+//
+void CProfilesGSTonesPlugin::ShowInfoNoteL( TInt aResourceId )
+    {
+    if( IsForeground() )
+        {
+        HBufC* infoText = StringLoader::LoadLC( aResourceId );
+        CAknGlobalNote* note = CAknGlobalNote::NewLC();
+        note->ShowNoteL( EAknGlobalInformationNote, *infoText );
+
+        CleanupStack::PopAndDestroy( 2, infoText );
+        }
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/ProfilesGSTonesPlugin/src/ProfilesGSTonesPluginImplementationTable.cpp	Wed Sep 01 12:30:29 2010 +0100
@@ -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 prxy table for plugin.
+*
+*/
+
+
+// System includes
+#include <e32std.h>
+#include <implementationproxy.h>
+
+// Internal includes
+#include "ProfilesGSTonesPlugin.h"
+#include "ProfilesUID.h"
+
+// Constants
+const TImplementationProxy KProfilesGSTonesPluginImplementationTable[] = 
+	{
+	IMPLEMENTATION_PROXY_ENTRY( IMPLEMENTATION_UID_PROFILES_GS_TONES_PLUGIN,
+                                CProfilesGSTonesPlugin::NewL )
+	};
+
+
+// ---------------------------------------------------------------------------
+// ImplementationGroupProxy
+// Gate/factory function
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( 
+    TInt& aTableCount )
+	{
+	aTableCount = sizeof( KProfilesGSTonesPluginImplementationTable ) 
+        / sizeof( TImplementationProxy );
+	return KProfilesGSTonesPluginImplementationTable;
+	}
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/rom/Profile.iby	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,47 @@
+/*
+* 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.
+*
+*/
+#ifndef __PROFILE_IBY__
+#define __PROFILE_IBY__
+
+S60_APP_EXE(ProfileApp)
+S60_APP_AIF_ICONS(ProfileApp)
+S60_APP_AIF_RSC(ProfileApp)
+
+file=ABI_DIR\BUILD_DIR\profilesettingsview.dll          SHARED_LIB_DIR\profilesettingsview.dll
+
+#ifdef RD_GS_RENOVATION
+
+#ifndef RD_CONTROL_PANEL
+// GS Tones View Plugin:
+ECOM_PLUGIN(profilesgstonesplugin.dll,1020729B.rsc)
+#endif // RD_CONTROL_PANEL
+
+#ifdef RD_CONTROL_PANEL
+// GS Profiles Plugin:
+ECOM_PLUGIN(GSProfilesPlugin.dll,10283386.rsc)
+data=DATAZ_\BITMAP_DIR\gsprofilesplugin.mif         BITMAP_DIR\gsprofilesplugin.mif
+#endif // RD_CONTROL_PANEL
+
+#endif // RD_GS_RENOVATION
+
+ECOM_PLUGIN(profileaiwprovider.dll,10281F18.rsc)
+
+//Configration file of PSMProfilesPlugin
+data=ZPRIVATE\2000B187\10283386.xml		private\2000B187\10283386.xml
+
+#endif // PROFILE_IBY
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/rom/ProfileResources.iby	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  Iby files for Profile.
+*
+*/
+#ifndef __PROFILE_RESOURCES_IBY__
+#define __PROFILE_RESOURCES_IBY__
+
+
+S60_APP_CAPTION(profileapp)
+
+//Resource file(s) for ProfileApp
+
+data=DATAZ_\APP_RESOURCE_DIR\profileapp.rsc                      APP_RESOURCE_DIR\profileapp.rsc
+
+data=ZRESOURCE\profilesettingsview.rsc                               	RESOURCE_FILES_DIR\profilesettingsview.rsc
+
+#ifdef RD_GS_RENOVATION
+
+#ifndef RD_CONTROL_PANEL
+// Resource file for GS Tones View plugin
+data=ZRESOURCE\profilesgstonespluginrsc.rsc                      RESOURCE_FILES_DIR\profilesgstonespluginrsc.rsc
+#endif // RD_CONTROL_PANEL
+
+#ifdef RD_CONTROL_PANEL
+// Resource file for GS Profiles plugin
+data=ZRESOURCE\GSProfilesPluginRsc.rsc                           RESOURCE_FILES_DIR\GSProfilesPluginRsc.rsc
+#endif // RD_CONTROL_PANEL
+
+#endif // RD_GS_RENOVATION
+
+data=ZRESOURCE\profileaiwproviderresource.rsc	RESOURCE_FILES_DIR\profileaiwproviderresource.rsc
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/tsrc/public/basic/group/bld.inf	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,22 @@
+/*
+* 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
+*    Profiles tests
+*
+*/
+
+////////////////////////////////////////////////////////////
+// bld.inf
+
+#include "../../../../ProfileApp/tsrc/public/basic/group/bld.inf"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/Profiles/tsrc/public/basic/rom/Profiles_ats3.iby	Wed Sep 01 12:30:29 2010 +0100
@@ -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 Profiles automated tests
+*       
+*
+*/
+
+#ifndef __PROFILES_ATS3_IBY__
+#define __PROFILES_ATS3_IBY__
+
+// THESE ARE INCLUDED IN PROFILESAPPLICATION_ATS3_IBY
+
+// Profiles rom files
+//file=ABI_DIR\BUILD_DIR\T_ProfileSettingsView.dll    SHARED_LIB_DIR\T_ProfileSettingsView.dll
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/group/bld.inf	Wed Sep 01 12:30:29 2010 +0100
@@ -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:  This file provides the information required for building ProfilesApplicaton.
+*
+*/
+
+
+#include "../Profiles/Group/bld.inf"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/tsrc/public/basic/group/bld.inf	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,22 @@
+/*
+* 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 "../../../../Profiles/tsrc/public/basic/group/bld.inf"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/tsrc/public/basic/rom/ProfilesApplication_ats3.iby	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,27 @@
+/*
+* 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 __PROFILESAPPLICATION_ATS3_IBY__
+#define __PROFILESAPPLICATION_ATS3_IBY__
+
+// Profiles rom files
+file=ABI_DIR\BUILD_DIR\T_ProfileSettingsView.dll    SHARED_LIB_DIR\T_ProfileSettingsView.dll
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profilesapplication/tsrc/public/basic/test.xml	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<test>
+    <name>ProfilesApplication 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="ProfilesApplication 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_ProfilesApplication_ats3_image.fpsx" />
+                    <flash target-alias="DEFAULT" images="ATS3Drop/images/sydo_ProfilesApplication_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_ProfileSettingsView"/>
+                            <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_ProfilesApplication_ats3_image.fpsx</file>
+        <file>ATS3Drop/images/sydo_ProfilesApplication_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\ProfilesApplication\"/>
+        </params>
+    </postAction>
+</test>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysdef_1_4_0.dtd	Wed Sep 01 12:30:29 2010 +0100
@@ -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>  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/group/bld.inf	Wed Sep 01 12:30:29 2010 +0100
@@ -0,0 +1,24 @@
+/*
+* 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
+*     Profile ADO API test cases.
+*
+*/
+
+////////////////////////////////////////////////////////////
+// bld.inf
+// Part of EUnit library test
+
+#include "../../profile_plat/profiles_settings_view_api/tsrc/group/bld.inf"