Revert last code drop.
authorPat Downey <patd@symbian.org>
Fri, 04 Jun 2010 10:21:36 +0100
changeset 24 6df133bd92e1
parent 23 a2b50a479edf
child 25 4177d7e75bb1
child 28 075425b8d9a4
Revert last code drop.
hswidgetplugin/buildflags.pri
hswidgetplugin/fmradiohswidgetplugin/fmradiohswidgetplugin.pro
hswidgetplugin/fmradiohswidgetplugin/fmradiohswidgetplugin.xml
hswidgetplugin/fmradiohswidgetplugin/inc/fmradiohswidget.h
hswidgetplugin/fmradiohswidgetplugin/inc/fmradiohswidgetplugin.h
hswidgetplugin/fmradiohswidgetplugin/inc/fmradiohswidgetprocesshandler.h
hswidgetplugin/fmradiohswidgetplugin/inc/fmradiohswidgetprofilereader.h
hswidgetplugin/fmradiohswidgetplugin/inc/fmradiohswidgetradioserviceclient.h
hswidgetplugin/fmradiohswidgetplugin/qmakepluginstubs/fmradiohswidgetplugin.qtplugin
hswidgetplugin/fmradiohswidgetplugin/resource/fmradiohswidget.docml
hswidgetplugin/fmradiohswidgetplugin/resource/fmradiohswidgetplugin.css
hswidgetplugin/fmradiohswidgetplugin/resource/fmradiohswidgetplugin.manifest
hswidgetplugin/fmradiohswidgetplugin/resource/fmradiohswidgetplugin.s60xml
hswidgetplugin/fmradiohswidgetplugin/resource/fmradiohswidgetplugin.xml
hswidgetplugin/fmradiohswidgetplugin/resource/fmradiohswidgetplugin_icon.png
hswidgetplugin/fmradiohswidgetplugin/resources.qrc
hswidgetplugin/fmradiohswidgetplugin/src/fmradiohswidget.cpp
hswidgetplugin/fmradiohswidgetplugin/src/fmradiohswidgetplugin.cpp
hswidgetplugin/fmradiohswidgetplugin/src/fmradiohswidgetprocesshandler.cpp
hswidgetplugin/fmradiohswidgetplugin/src/fmradiohswidgetprofilereader.cpp
hswidgetplugin/fmradiohswidgetplugin/src/fmradiohswidgetradioserviceclient.cpp
hswidgetplugin/fmradiohswidgetplugin_exports_to_rom.pri
hswidgetplugin/fmradiohswidgetplugininstaller/fmradiohswidgetplugininstaller.cpp
hswidgetplugin/fmradiohswidgetplugininstaller/fmradiohswidgetplugininstaller.pro
hswidgetplugin/hswidgetplugin.pro
hswidgetplugin/rom/fmradiohswidgetplugin.iby
hswidgetplugin/rom/fmradiohswidgetplugin_stub.pkg
hswidgetplugin/rom/fmradiohswidgetplugininstaller.iby
hswidgetplugin/sis/fmradiohswidgetplugin.pkg
layers.sysdef.xml
radio.pro
radioapp/bin/fmradio_en_US.qm
radioapp/buildflags.pri
radioapp/bwins/radioenginewrapperu.def
radioapp/bwins/radiopresetstorageu.def
radioapp/bwins/radiouiengineu.def
radioapp/bwins/radiowidgetsu.def
radioapp/commoninc/radio_global.h
radioapp/commoninc/radiologger.h
radioapp/commoninc/radionotificationdata.h
radioapp/commoninc/radioservicedef.h
radioapp/eabi/radioenginewrapperu.def
radioapp/eabi/radiopresetstorageu.def
radioapp/eabi/radiouiengineu.def
radioapp/eabi/radiowidgetsu.def
radioapp/radioapp.pro
radioapp/radioapplication/inc/radioapplication.h
radioapp/radioapplication/inc/testwindow_win32.h
radioapp/radioapplication/radioapplication.pro
radioapp/radioapplication/resources/compile_ts.bat
radioapp/radioapplication/resources/fmradio.ts
radioapp/radioapplication/resources/service_conf.xml
radioapp/radioapplication/src/main.cpp
radioapp/radioapplication/src/radioapplication.cpp
radioapp/radioapplication/src/testwindow_win32.cpp
radioapp/radioenginewrapper/inc/cradioenginehandler.h
radioapp/radioenginewrapper/inc/mradioenginehandlerobserver.h
radioapp/radioenginewrapper/inc/radiocontroleventlistener.h
radioapp/radioenginewrapper/inc/radioenginewrapper.h
radioapp/radioenginewrapper/inc/radioenginewrapper_p.h
radioapp/radioenginewrapper/inc/radioenginewrapper_win32_p.h
radioapp/radioenginewrapper/inc/radioenginewrapperobserver.h
radioapp/radioenginewrapper/inc/radioenummapper.h
radioapp/radioenginewrapper/inc/radiordslistener.h
radioapp/radioenginewrapper/inc/radiosettings.h
radioapp/radioenginewrapper/inc/radiosettings_p.h
radioapp/radioenginewrapper/inc/radiosettingsif.h
radioapp/radioenginewrapper/inc/radiostationhandlerif.h
radioapp/radioenginewrapper/inc/radiowrapperexport.h
radioapp/radioenginewrapper/inc/settings.xml
radioapp/radioenginewrapper/inc/t_radiodataparser.h
radioapp/radioenginewrapper/radioenginewrapper.pro
radioapp/radioenginewrapper/src/cradioenginehandler.cpp
radioapp/radioenginewrapper/src/radiocontroleventlistener.cpp
radioapp/radioenginewrapper/src/radioenginewrapper.cpp
radioapp/radioenginewrapper/src/radioenginewrapper_p.cpp
radioapp/radioenginewrapper/src/radioenginewrapper_win32.cpp
radioapp/radioenginewrapper/src/radioenginewrapper_win32_p.cpp
radioapp/radioenginewrapper/src/radioenginewrapperobserver.cpp
radioapp/radioenginewrapper/src/radiologger.cpp
radioapp/radioenginewrapper/src/radiordslistener.cpp
radioapp/radioenginewrapper/src/radiosettings.cpp
radioapp/radioenginewrapper/src/radiosettings_p.cpp
radioapp/radioenginewrapper/src/radiosettings_win32_p.cpp
radioapp/radioenginewrapper/src/t_radiodataparser.cpp
radioapp/radiopresetstorage/inc/radiopresetstorage.h
radioapp/radiopresetstorage/inc/radiopresetstorage_p.h
radioapp/radiopresetstorage/inc/radiopresetstorage_win32_p.h
radioapp/radiopresetstorage/inc/radiopresetstorageexport.h
radioapp/radiopresetstorage/inc/radiostationif.h
radioapp/radiopresetstorage/radiopresetstorage.pro
radioapp/radiopresetstorage/src/radiopresetstorage.cpp
radioapp/radiopresetstorage/src/radiopresetstorage_win32.cpp
radioapp/radiopresetstorage/tsrc/inc/t_radiopresetstorage.h
radioapp/radiopresetstorage/tsrc/src/t_radiopresetstorage.cpp
radioapp/radiopresetstorage/tsrc/t_radiopresetstorage.pro
radioapp/radiouiengine/inc/radiocarouselmodel.h
radioapp/radiouiengine/inc/radiocarouselmodel_p.h
radioapp/radiouiengine/inc/radiocontrolservice.h
radioapp/radiouiengine/inc/radiohistoryitem.h
radioapp/radiouiengine/inc/radiohistoryitem_p.h
radioapp/radiouiengine/inc/radiohistorymodel.h
radioapp/radiouiengine/inc/radiohistorymodel_p.h
radioapp/radiouiengine/inc/radiomonitorservice.h
radioapp/radiouiengine/inc/radiomonitorservice_win32.h
radioapp/radiouiengine/inc/radioscannerengine.h
radioapp/radiouiengine/inc/radioscannerengine_p.h
radioapp/radiouiengine/inc/radiostation.h
radioapp/radiouiengine/inc/radiostation_p.h
radioapp/radiouiengine/inc/radiostationfiltermodel.h
radioapp/radiouiengine/inc/radiostationmodel.h
radioapp/radiouiengine/inc/radiostationmodel_p.h
radioapp/radiouiengine/inc/radiouiengine.h
radioapp/radiouiengine/inc/radiouiengine_p.h
radioapp/radiouiengine/inc/radiouiengineexport.h
radioapp/radiouiengine/radiouiengine.pro
radioapp/radiouiengine/src/radiocarouselmodel.cpp
radioapp/radiouiengine/src/radiocarouselmodel_p.cpp
radioapp/radiouiengine/src/radiocontrolservice.cpp
radioapp/radiouiengine/src/radiohistoryitem.cpp
radioapp/radiouiengine/src/radiohistoryitem_p.cpp
radioapp/radiouiengine/src/radiohistorymodel.cpp
radioapp/radiouiengine/src/radiohistorymodel_p.cpp
radioapp/radiouiengine/src/radiomonitorservice.cpp
radioapp/radiouiengine/src/radiomonitorservice_win32.cpp
radioapp/radiouiengine/src/radioscannerengine.cpp
radioapp/radiouiengine/src/radioscannerengine_p.cpp
radioapp/radiouiengine/src/radiostation.cpp
radioapp/radiouiengine/src/radiostation_p.cpp
radioapp/radiouiengine/src/radiostationfiltermodel.cpp
radioapp/radiouiengine/src/radiostationmodel.cpp
radioapp/radiouiengine/src/radiostationmodel_p.cpp
radioapp/radiouiengine/src/radiouiengine.cpp
radioapp/radiouiengine/src/radiouiengine_p.cpp
radioapp/radiouiengine/tsrc/inc/t_radiostation.h
radioapp/radiouiengine/tsrc/src/t_radiostation.cpp
radioapp/radiouiengine/tsrc/t_radiouiengine.pro
radioapp/radiowidgets/inc/radiobannerlabel.h
radioapp/radiowidgets/inc/radiofadinglabel.h
radioapp/radiowidgets/inc/radiofrequencyitem.h
radioapp/radiowidgets/inc/radiofrequencyscanner.h
radioapp/radiowidgets/inc/radiofrequencystrip.h
radioapp/radiowidgets/inc/radiohistoryview.h
radioapp/radiowidgets/inc/radiomainview.h
radioapp/radiowidgets/inc/radiostationcarousel.h
radioapp/radiowidgets/inc/radiostationitem.h
radioapp/radiowidgets/inc/radiostationsview.h
radioapp/radiowidgets/inc/radiostripbase.h
radioapp/radiowidgets/inc/radiouiloader.h
radioapp/radiowidgets/inc/radiouiutilities.h
radioapp/radiowidgets/inc/radioviewbase.h
radioapp/radiowidgets/inc/radiowidgetsexport.h
radioapp/radiowidgets/inc/radiowindow.h
radioapp/radiowidgets/radiowidgets.pro
radioapp/radiowidgets/res/effects/blink_in_out_in.fxml
radioapp/radiowidgets/res/effects/fade_in.fxml
radioapp/radiowidgets/res/effects/fade_out.fxml
radioapp/radiowidgets/res/effects/slide_from_left.fxml
radioapp/radiowidgets/res/effects/slide_from_right.fxml
radioapp/radiowidgets/res/effects/slide_to_left.fxml
radioapp/radiowidgets/res/effects/slide_to_right.fxml
radioapp/radiowidgets/res/fmradioui.qrc
radioapp/radiowidgets/res/images/nowplayingicon.png
radioapp/radiowidgets/res/images/pri_small_shazam.svg
radioapp/radiowidgets/res/images/pri_small_star.svg
radioapp/radiowidgets/res/images/pri_small_star_inactive.svg
radioapp/radiowidgets/res/images/pri_small_tag.svg
radioapp/radiowidgets/res/images/qtg_fr_lcd.svg
radioapp/radiowidgets/res/images/qtg_fr_lcd_overlay.svg
radioapp/radiowidgets/res/images/qtg_fr_tuner.svg
radioapp/radiowidgets/res/images/qtg_mono_next.svg
radioapp/radiowidgets/res/images/qtg_mono_play_history.svg
radioapp/radiowidgets/res/images/qtg_mono_previous.svg
radioapp/radiowidgets/res/images/qtg_mono_radio_stations.svg
radioapp/radiowidgets/res/images/qtg_mono_speaker.svg
radioapp/radiowidgets/res/images/qtg_mono_speaker_off.svg
radioapp/radiowidgets/res/images/qtg_mono_station_scan.svg
radioapp/radiowidgets/res/images/qtg_mono_tag.svg
radioapp/radiowidgets/res/images/setfavoriteicon.png
radioapp/radiowidgets/res/images/stripbackground.png
radioapp/radiowidgets/res/layout/historyview.docml
radioapp/radiowidgets/res/layout/mainview.docml
radioapp/radiowidgets/res/layout/radiostationitem.css
radioapp/radiowidgets/res/layout/radiostationitem.widgetml
radioapp/radiowidgets/res/layout/stationsview.docml
radioapp/radiowidgets/src/radiobannerlabel.cpp
radioapp/radiowidgets/src/radiofadinglabel.cpp
radioapp/radiowidgets/src/radiofrequencyitem.cpp
radioapp/radiowidgets/src/radiofrequencyscanner.cpp
radioapp/radiowidgets/src/radiofrequencystrip.cpp
radioapp/radiowidgets/src/radiohistoryview.cpp
radioapp/radiowidgets/src/radiomainview.cpp
radioapp/radiowidgets/src/radiostationcarousel.cpp
radioapp/radiowidgets/src/radiostationitem.cpp
radioapp/radiowidgets/src/radiostationsview.cpp
radioapp/radiowidgets/src/radiostripbase.cpp
radioapp/radiowidgets/src/radiouiloader.cpp
radioapp/radiowidgets/src/radiouiutilities.cpp
radioapp/radiowidgets/src/radioviewbase.cpp
radioapp/radiowidgets/src/radiowindow.cpp
radioapp/radiowidgetsplugin/main.cpp
radioapp/radiowidgetsplugin/radiowidgetsplugin.pro
radioengine/engine/api/cradioengine.h
radioengine/engine/api/mradioengineinitializer.h
radioengine/engine/api/mradioengineobserver.h
radioengine/engine/api/mradiordsdataobserver.h
radioengine/engine/api/mradiordsreceiver.h
radioengine/engine/api/mradioscanobserver.h
radioengine/engine/bwins/radioengineu.def
radioengine/engine/eabi/radioengineu.def
radioengine/engine/group/bld.inf
radioengine/engine/group/radioengine.mmp
radioengine/engine/inc/cradioengineimp.h
radioengine/engine/inc/cradionetworkinfolistener.h
radioengine/engine/inc/cradiordsreceiver.h
radioengine/engine/inc/cradiordsreceiverbase.h
radioengine/engine/inc/t_cradiordsreceiversimulator.h
radioengine/engine/src/cradioengine.cpp
radioengine/engine/src/cradioengineimp.cpp
radioengine/engine/src/cradionetworkinfolistener.cpp
radioengine/engine/src/cradiordsreceiver.cpp
radioengine/engine/src/cradiordsreceiverbase.cpp
radioengine/engine/src/t_cradiordsreceiversimulator.cpp
radioengine/group/bld.inf
radioengine/group/buildflags.hrh
radioengine/settings/api/cradioregion.h
radioengine/settings/api/cradiosettings.h
radioengine/settings/api/mradioapplicationsettings.h
radioengine/settings/api/mradioenginesettings.h
radioengine/settings/api/mradiosettingsobserver.h
radioengine/settings/api/mradiosettingssetter.h
radioengine/settings/bwins/radioenginesettingsu.def
radioengine/settings/cenrep/101FF976.txt
radioengine/settings/cenrep/keys_radioengine.xls
radioengine/settings/data/radioenginesettings.rss
radioengine/settings/eabi/radioenginesettingsu.def
radioengine/settings/group/backup_registration.xml
radioengine/settings/group/bld.inf
radioengine/settings/group/radioenginesettings.mmp
radioengine/settings/inc/cradioapplicationsettings.h
radioengine/settings/inc/cradioenginesettings.h
radioengine/settings/inc/cradiosettingsbase.h
radioengine/settings/inc/cradiosettingsimp.h
radioengine/settings/inc/radiopreset.hrh
radioengine/settings/inc/radiosettings.rh
radioengine/settings/src/cradioapplicationsettings.cpp
radioengine/settings/src/cradioenginesettings.cpp
radioengine/settings/src/cradioregion.cpp
radioengine/settings/src/cradiosettings.cpp
radioengine/settings/src/cradiosettingsbase.cpp
radioengine/settings/src/cradiosettingsimp.cpp
radioengine/utils/api/cradioaudiorouter.h
radioengine/utils/api/cradioenginelogger.h
radioengine/utils/api/cradiopubsub.h
radioengine/utils/api/cradioremcontarget.h
radioengine/utils/api/cradiorepositorymanager.h
radioengine/utils/api/cradioroutableaudio.h
radioengine/utils/api/cradiosystemeventcollector.h
radioengine/utils/api/mradioaudioroutingobserver.h
radioengine/utils/api/mradiocontroleventobserver.h
radioengine/utils/api/mradioenginelogger.h
radioengine/utils/api/mradiorepositoryentityobserver.h
radioengine/utils/api/mradiosystemeventobserver.h
radioengine/utils/api/radioengine.hrh
radioengine/utils/api/radioenginedef.h
radioengine/utils/api/radioengineutils.h
radioengine/utils/api/radiointernalcrkeys.h
radioengine/utils/api/radiointernalpskeys.h
radioengine/utils/api/radiouid.hrh
radioengine/utils/bwins/radioengineutilsu.def
radioengine/utils/eabi/radioengineutilsu.def
radioengine/utils/group/bld.inf
radioengine/utils/group/radioengineutils.mmp
radioengine/utils/inc/cradioaccessoryobserver.h
radioengine/utils/inc/cradioenginetls.h
radioengine/utils/inc/cradiopropertyobserver.h
radioengine/utils/inc/cradiopubsubimp.h
radioengine/utils/inc/cradioremcontargetimp.h
radioengine/utils/inc/cradiorepositoryentity.h
radioengine/utils/inc/cradiorepositoryentity.inl
radioengine/utils/inc/cradiorepositoryentitybase.h
radioengine/utils/inc/cradiorepositorymanagerimp.h
radioengine/utils/inc/cradiosystemeventcollectorimp.h
radioengine/utils/inc/cradiosystemeventdetector.h
radioengine/utils/inc/mradioheadseteventobserver.h
radioengine/utils/inc/mradiosystemeventdetectorobserver.h
radioengine/utils/src/cradioaccessoryobserver.cpp
radioengine/utils/src/cradioaudiorouter.cpp
radioengine/utils/src/cradioenginelogger.cpp
radioengine/utils/src/cradioenginetls.cpp
radioengine/utils/src/cradiopropertyobserver.cpp
radioengine/utils/src/cradiopubsub.cpp
radioengine/utils/src/cradiopubsubimp.cpp
radioengine/utils/src/cradioremcontarget.cpp
radioengine/utils/src/cradioremcontargetimp.cpp
radioengine/utils/src/cradiorepositoryentitybase.cpp
radioengine/utils/src/cradiorepositorymanager.cpp
radioengine/utils/src/cradiorepositorymanagerimp.cpp
radioengine/utils/src/cradioroutableaudio.cpp
radioengine/utils/src/cradiosystemeventcollector.cpp
radioengine/utils/src/cradiosystemeventcollectorimp.cpp
radioengine/utils/src/cradiosystemeventdetector.cpp
radioengine/utils/src/radioengineutils.cpp
rom/bld.inf
rom/fmradio.iby
rom/fmradio_resources.iby
rom/qtfmradio_stub.pkg
sysdef_1_5_1.dtd
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hswidgetplugin/buildflags.pri	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,23 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+# $$_PRO_FILE_PWD_ points to the directory of the pro file
+MOC_DIR         = $$_PRO_FILE_PWD_/tmp
+RCC_DIR         = $$_PRO_FILE_PWD_/tmp
+OBJECTS_DIR     = $$_PRO_FILE_PWD_/tmp
+UI_DIR          = $$_PRO_FILE_PWD_/tmp
+UI_HEADERS_DIR  = $$_PRO_FILE_PWD_/tmp
+UI_SOURCES_DIR  = $$_PRO_FILE_PWD_/tmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hswidgetplugin/fmradiohswidgetplugin/fmradiohswidgetplugin.pro	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,81 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: Example of home screen widget
+#
+
+include(../buildflags.pri)
+
+TEMPLATE = lib
+CONFIG += plugin mobility hb
+MOBILITY = serviceframework
+
+LIBS += -lxqsettingsmanager \
+		-lxqservice \
+		-lxqserviceutil
+
+HEADERS += ./inc/*.h
+SOURCES += ./src/*.cpp
+
+INCLUDEPATH += ./inc
+INCLUDEPATH += ../../radioapp/commoninc
+
+UID = 2002E6D6
+
+RESOURCES = resources.qrc
+#exportResources(./resource/$${TARGET}_icon*.png, $$PLUGIN_SUBDIR)
+
+symbian: {
+
+    DESTDIR = /private/20022F35/import/widgetregistry/$${UID}
+    INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+
+    TARGET.UID3 = 0x$${UID}
+    TARGET.EPOCALLOWDLLDATA=1
+    TARGET.CAPABILITY = ALL -TCB
+    
+    plugins.path = $${DESTDIR}
+    plugins.sources = $${TARGET}.dll 
+    
+    widgetResources.path = $${DESTDIR}
+# commented out
+#    widgetResources.sources += resource/$${TARGET}.s60xml
+# Use this in emulator instead of xml in resources directory.    
+#    widgetResources.sources += $${TARGET}.xml
+    widgetResources.sources += resource/$${TARGET}.xml
+    widgetResources.sources += resource/$${TARGET}.manifest
+# icon is now removed to be able to unistall the widget more easily.
+#    widgetResources.sources += resource/$${TARGET}_icon*.png
+        
+    DEPLOYMENT += plugins \
+                  widgetResources
+}
+
+win32: {
+
+    CONFIG(debug, debug|release) {
+      SUBDIRPART = debug
+    } else {
+      SUBDIRPART = release
+    }    
+    
+    PLUGIN_SUBDIR = /hsresources/import/widgetregistry/$${UID}
+    
+    DESTDIR = $$PWD/../../../../../bin/$${SUBDIRPART}/$${PLUGIN_SUBDIR}
+
+    manifest.path = $${DESTDIR}
+    manifest.files = ./resource/*.manifest ./resource/*.xml ./resource/*.css #./resource/*.png
+    
+    INSTALLS += manifest    
+    
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hswidgetplugin/fmradiohswidgetplugin/fmradiohswidgetplugin.xml	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<service>
+    <name>fmradiohswidgetplugin</name>
+    <filepath>c:/private/20022F35/import/widgetregistry/2002E6D6/fmradiohswidgetplugin.qtplugin</filepath>
+    <description>FM Radio homescreen widget</description>
+    <interface>
+        <name>com.nokia.IHomeScreenWidget</name>
+        <version>1.0</version>
+        <description>FM Radio homescreen widget</description>
+        <capabilities></capabilities>
+        <customproperty key="iconuri">fmradiohswidgetplugin_icon.png</customproperty>
+        <customproperty key="title">FM Radio Widget</customproperty>
+    </interface>
+</service>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hswidgetplugin/fmradiohswidgetplugin/inc/fmradiohswidget.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,231 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  FM Radio home screen widget
+*
+*/
+
+#ifndef FMRADIOHSWIDGET_H
+#define FMRADIOHSWIDGET_H
+
+// System includes
+#include <HbWidget>
+
+// User includes
+#include "fmradiohswidgetradioserviceclient.h"
+
+// Forward declarations
+class HbLabel;
+class HbPushButton;
+class HbMarqueeItem;
+class XQSettingsManager;
+class XQSettingsKey;
+class FmRadioHsWidgetProcessHandler;
+class FmRadioHsWidgetProfileReader;
+class QGraphicsLinearLayout;
+
+// Defines
+const QString KDocml = ":/ui/resource/fmradiohswidget.docml";
+const QString KCss = ":/ui/resource/fmradiohswidgetplugin.css";
+
+// Constants
+/**  Key for radio information hash. */
+const QString KRadioInformationStationName = "stationName";
+/**  Key for radio information hash. */
+const QString KRadioInformationCallSign = "callSign";
+/**  Key for radio information hash. */
+const QString KRadioInformationFrequency = "frequency";
+/**  Key for radio information hash. */
+const QString KRadioInformationRt = "rt";
+/**  Key for radio information hash. */
+const QString KRadioInformationDynamicPsName = "dynamicPsName";
+/**  Key for radio information hash. */
+const QString KRadioInformationPty = "pty";
+/**  Key for radio information hash. */
+const QString KRadioInformationHomePage = "homePage";
+/**  Key for radio information hash. */
+const QString KRadioInformationSong = "song";
+/**  Text to display in widget. */
+const QString KFmRadioText = "FM Radio";
+/**  Information text to connect headset. */
+const QString KConnectHeadsetText = "Connect wired headset.";
+/**  Mhz text. */
+const QString KMhzText = "Mhz";
+/**  DOCML object name for mainLayout */
+const QString KDocmlObjectNameMainLayout = "mainLayout";
+/**  DOCML object name for radioIconPushButton */
+const QString KDocmlObjectNameRadioIconPushButton = "radioIconPushButton";
+/**  DOCML object name for verticalSeparatorLabel */
+const QString KDocmlObjectNameVerticalSeparatorLabel = "verticalSeparatorLabel";
+/**  DOCML object name for controlAreaLayout */
+const QString KDocmlObjectNameControlAreaLayout = "controlAreaLayout";
+/**  DOCML object name for previousPushButton */
+const QString KDocmlObjectNamePreviousPushButton = "previousPushButton";
+/**  DOCML object name for verticalButtonSeparatorLabel1 */
+const QString KDocmlObjectNameVerticalButtonSeparatorLabel1 = "verticalButtonSeparatorLabel1";
+/**  DOCML object name for playPushButton */
+const QString KDocmlObjectNamePlayPushButton = "playPushButton";
+/**  DOCML object name for verticalButtonSeparatorLabel2 */
+const QString KDocmlObjectNameVerticalButtonSeparatorLabel2 = "verticalButtonSeparatorLabel2";
+/**  DOCML object name for nextPushButton */
+const QString KDocmlObjectNameNextPushButton = "nextPushButton";
+/**  DOCML object name for twoRowsLayout */
+const QString KDocmlObjectNameTwoRowsLayout = "twoRowsLayout";
+/**  DOCML object name for oneRowLayout */
+const QString KDocmlObjectNameOneRowLayout = "oneRowLayout";
+/**  DOCML object name for animationLayout */
+const QString KDocmlObjectNameAnimationLayout = "animationLayout";
+/**  DOCML object name for firstRowLabel */
+const QString KDocmlObjectNameFirstRowLabel = "firstRowLabel";
+/**  DOCML object name for secondRowLabel */
+const QString KDocmlObjectNameSecondRowLabel = "secondRowLabel";
+/**  DOCML object name for lonelyRowLabel */
+const QString KDocmlObjectNameLonelyRowLabel = "lonelyRowLabel";
+/**  DOCML object name for animationIcon */
+const QString KDocmlObjectNameAnimationIcon = "animationIcon";
+
+class FmRadioHsWidget : public HbWidget
+{
+    Q_OBJECT
+
+public:
+    FmRadioHsWidget(QGraphicsItem *parent = 0, Qt::WindowFlags flags = 0);
+    ~FmRadioHsWidget();
+
+    // enum for commands controlling FM Radio
+    enum FmRadioControlCommand
+    {
+        Mute,
+        Unmute,
+        PreviousChannel,
+        NextChannel
+    };
+
+    // enum for FM Radio states
+    enum FmRadioState
+    {
+        Undefined,
+        NotRunning,
+        Starting,
+        Running,
+        ControllingAudio,
+        NotControllingAudio,
+        Seeking,
+        AntennaNotConnected
+    };
+
+    // enum for information area layout states
+    enum InformationAreaLayout
+    {
+        OneRow,
+        TwoRows,
+        Animation
+    };
+
+    // enum for control button states
+    enum ControlButtonState
+    {
+        AllDisabledPlay,
+        AllDisabledStop,
+        ChannelsDisabledPlay,
+        ChannelsDisabledStop,
+        ChannelsEnabledPlay,
+        ChannelsEnabledStop
+    };
+
+    // enum for control button states
+    enum PlayButtonState
+    {
+        PlayDisabled,
+        PlayEnabled,
+        StopDisabled,
+        StopEnabled
+    };
+    
+    enum ControlButtonPosition
+    {
+        Left,
+        Center,
+        Right
+    };
+
+public slots:
+    //void onInitialize(); // Can be used in future to get on intialize event.
+    void onShow();
+    void onHide();
+    //void onUninitialize(); // Can be used in future to get on unintialize event.
+
+    bool eventFilter(QObject *target, QEvent *event);
+    
+private slots:
+    void load(const QString docml);
+    
+    void mute();
+    void unMute();
+    void previousChannel();
+    void nextChannel();
+    void radioToForeground();
+    void radioToBackground();
+    bool openUrl(QUrl url);
+
+    void handleRadioInformationChange(int notificationId, QVariant value);
+    bool updateRadioInformation(const QString informationType, QString information);
+    void radioInformationChanged();
+    void clearRadioInformation();
+    void handleRadioStateChange(QVariant value);
+    
+    void changeInformationAreaLayout(InformationAreaLayout layout);
+    void changeControlButtonState(ControlButtonState buttonState);
+    void changePlayButtonState(PlayButtonState buttonState);
+    void changeChannelButtonsEnabledState(bool enabled);
+    void changeControlButtonFrameBackground(bool enabled, ControlButtonPosition position,
+        HbPushButton *button);
+    
+private:
+    // Data
+    Q_DISABLE_COPY(FmRadioHsWidget)
+    
+    HbPushButton *mRadioPushButton;
+    HbLabel *mVerticalSeparatorLabel;
+    HbPushButton *mPreviousPushButton;
+    HbLabel *mVerticalButtonSeparatorLabel1;
+    HbPushButton *mPlayPushButton;
+    HbLabel *mVerticalButtonSeparatorLabel2;
+    HbPushButton *mNextPushButton;
+    QGraphicsWidget *mInformationAreaOneRowLayout;
+    QGraphicsWidget *mInformationAreaTwoRowsLayout;
+    QGraphicsWidget *mInformationAreaAnimationLayout;
+    HbLabel *mInformationFirstRowLabel; // This should be maybe a HbLineEdit for displaying and receiving click on url's.
+    //HbMarqueeItem *mInformationFirstRowMarquee;
+    HbLabel *mInformationSecondRowLabel;// HbLineEdit may also support marquee/scrolling.
+    //HbMarqueeItem *mInformationSecondRowMarquee;
+    HbLabel *mInformationLonelyRowLabel;
+    //HbMarqueeItem *mInformationLonelyRowMarquee;
+    HbLabel *mAnimationIcon;
+    
+    FmRadioState mFmRadioState;
+    PlayButtonState mPlayButtonState;
+    bool mIsFavoriteChannels;
+
+    QHash<QString, QString> mRadioInformation;  // Stores the radio information
+    QString mRadioInformationFirstRow;
+    QString mRadioInformationSecondRow;
+
+    FmRadioHsWidgetProcessHandler *mProcessHandler; // For launching the FM Radio application
+    FmRadioHsWidgetProfileReader *mProfileMonitor;
+    
+    FmRadioHsWidgetRadioServiceClient *mRadioServiceClient; // For communicating with the FM Radio through Qt Highway
+    
+};
+
+#endif // FMRADIOHSWIDGET_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hswidgetplugin/fmradiohswidgetplugin/inc/fmradiohswidgetplugin.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  FM Radio home screen widget plugin
+*
+*/
+
+#ifndef FMRADIOHSWIDGETPLUGIN_H
+#define FMRADIOHSWIDGETPLUGIN_H
+
+#include <QObject>
+#include <qserviceplugininterface.h>
+
+QTM_USE_NAMESPACE
+class FmRadioHsWidgetPlugin : public QObject, public QServicePluginInterface
+{
+    Q_OBJECT
+    Q_INTERFACES(QtMobility::QServicePluginInterface)
+
+public:
+    QObject *createInstance(const QServiceInterfaceDescriptor &descriptor,
+                            QServiceContext *context,
+                            QAbstractSecuritySession *session);
+};
+
+#endif // FMRADIOHSWIDGETPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hswidgetplugin/fmradiohswidgetplugin/inc/fmradiohswidgetprocesshandler.h	Fri Jun 04 10:21:36 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: FM Radio widget process handler
+*
+*/
+
+#ifndef FMRADIOHSWIDGETPROCESSHANDLER_H_
+#define FMRADIOHSWIDGETPROCESSHANDLER_H_
+
+// System includes
+#include <QObject>
+#include <QProcess>
+
+// User includes
+
+// Forward declarations
+#include <QVariant>
+
+// Constants
+/**  FM Radio application executable. */
+const QString KRadioExecutablePath = "/sys/bin/qtfmradio.exe"; // TODO: Remove the hard coded path and use some util to determine the path instead.
+/**  Arguments for FM Radio application executable. */
+const QString KRadioExecutableArguments = "";
+
+class FmRadioHsWidgetProcessHandler : public QObject
+{
+Q_OBJECT
+
+public:
+    FmRadioHsWidgetProcessHandler(QObject *parent = 0);
+    ~FmRadioHsWidgetProcessHandler();
+
+public:
+    void startFmRadioApplication();
+
+signals:
+    void fmRadioApplicationStateChanged(QVariant state);
+
+public slots:
+    void handleStateChange(QProcess::ProcessState state);
+    void handleError(QProcess::ProcessError error);
+    void handleFinish(int exitCode, QProcess::ExitStatus exitStatus);
+
+private:
+    QProcess* mProcess;
+        
+};
+
+#endif /* FMRADIOHSWIDGETPROCESSHANDLER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hswidgetplugin/fmradiohswidgetplugin/inc/fmradiohswidgetprofilereader.h	Fri Jun 04 10:21:36 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: FM Radio widget profile reader
+*
+*/
+
+#ifndef FMRADIOHSWIDGETPROFILEREADER_H_
+#define FMRADIOHSWIDGETPROFILEREADER_H_
+
+// System includes
+#include <QObject>
+#include <QVariant>
+
+// Forward declarations
+class XQSettingsManager;
+class XQSettingsKey;
+
+class FmRadioHsWidgetProfileReader : public QObject
+{
+Q_OBJECT
+
+public:
+    FmRadioHsWidgetProfileReader(QObject *parent = 0);
+    virtual ~FmRadioHsWidgetProfileReader();
+    
+    QVariant radioStatus();
+
+signals:
+    void profileChanged(int profile);
+    void radioRunning(QVariant state);
+
+public slots:
+    void itemDeleted(const XQSettingsKey& key);
+    //void handleChanges(const XQSettingsKey& key, const QVariant& value);
+    void handleRadioRunningChanges(const XQSettingsKey& key, const QVariant& value);
+    
+private slots:
+    void currentProfileStatus(QVariant value);
+    void currentRadioRunningStatus(QVariant value);
+    
+    void startMonitoringRadioRunningStatus();
+    
+private: // data
+    XQSettingsManager *mSettingsManager; // For getting and P&S notifications
+    int mRadioStatus;
+
+};
+
+#endif /* FMRADIOHSWIDGETPROFILEREADER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hswidgetplugin/fmradiohswidgetplugin/inc/fmradiohswidgetradioserviceclient.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,121 @@
+/*
+* 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: FM Radio widget radio service client
+*
+*/
+
+#ifndef FMRADIOHSWIDGETRADIOSERVICECLIENT_H_
+#define FMRADIOHSWIDGETRADIOSERVICECLIENT_H_
+
+// System includes
+#include <QObject>
+#include <xqservicerequest.h>
+#include <xqappmgr.h>
+
+// Constants
+/**  Radio service name. */
+const QString KRadioServiceName = "com.nokia.services.Radio";
+/**  Radio control interface name. */
+const QString KRadioServiceControlInterfaceName = "IRadioControl";
+/**  Radio monitor interface name. */
+const QString KRadioServiceControlOperation = "command(int)";
+/**  Radio monitor interface name. */
+const QString KRadioServiceMonitorInterfaceName = "IRadioMonitor";
+/**  Radio monitor interface name. */
+const QString KRadioServiceMonitorOperation = "requestNotifications()";
+/**  Radio refresh operation name. */
+const QString KRadioServiceRefreshOperation = "requestAllData()";
+
+class FmRadioHsWidgetRadioServiceClient : public QObject
+{
+Q_OBJECT
+
+public:
+    FmRadioHsWidgetRadioServiceClient(QObject *parent = 0);
+    virtual ~FmRadioHsWidgetRadioServiceClient();
+    
+    enum FmRadioStartupState
+    {
+        StartForeground,
+        StartBackground
+    };
+    enum FmRadioChannelChangeCommand
+    {
+        PreviousFavouriteChannel,
+        NextFavouriteChannel
+    };
+    enum FmRadioAudioControlCommand
+    {
+        Mute,
+        Unmute
+    };
+    enum FmRadioInformationType
+    {
+        InformationTypeStationName,
+        InformationTypeCallSign,
+        InformationTypeFrequency,
+        InformationTypeRt,
+        InformationTypeDynamicPsName,
+        InformationTypePty
+    };
+    enum FmRadioVisibilty
+    {
+        DoNotChange,
+        ToForeground,
+        ToBackground
+    };
+
+    void init();
+
+signals:
+    void radioInformationChanged(int notificationId, QVariant value);
+    void radioStateChanged(QVariant value);
+
+public slots:
+    void doChangeFmRadioVisibility(FmRadioVisibilty visibility);
+    void test();
+    void doChangeFmRadioChannel(FmRadioChannelChangeCommand command);
+    void doControlFmRadioAudio(FmRadioAudioControlCommand command);
+    void handleFmRadioInformationChange(const QVariant& value);
+    void handleFmRadioStateChange(QVariant& value);
+    void startMonitoring(FmRadioVisibilty visibility);
+    void stopMonitoring();
+
+protected slots:
+    void requestCompleted(const QVariant& value);
+
+private slots:
+    //void handleOk(const QVariant &result);
+    void handleError(int errorCode, const QString& errorMessage);
+    void handleRequestError(int error);
+    
+    void createControlServiceRequest();
+    void createMonitorServiceRequest();
+
+    void doSendMonitorRequest(FmRadioVisibilty visibility);
+    void doSendControlRequest(QVariant &argument, FmRadioVisibilty visibility);
+    
+    void prepareRequestInfo(XQAiwRequest *request, FmRadioVisibilty visibility);
+    
+private: // data
+    bool mRequestPending;
+    XQApplicationManager mApplicationManager;
+    XQAiwRequest* mRadioMonitorRequest;
+    XQAiwRequest* mRadioControlRequest;
+    
+    bool                mDataInitialized;
+
+};
+
+#endif /* FMRADIOHSWIDGETRADIOSERVICECLIENT_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hswidgetplugin/fmradiohswidgetplugin/qmakepluginstubs/fmradiohswidgetplugin.qtplugin	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,1 @@
+This file is a Qt plugin stub file. The real Qt plugin is located in /sys/bin. Created:2010-04-23T11:50:39
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hswidgetplugin/fmradiohswidgetplugin/resource/fmradiohswidget.docml	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="1.0">
+    <widget name="mainLayout" type="HbWidget">
+        <widget name="radioIconPushButton" type="HbPushButton">
+            <icon iconName="qtg_large_radio" name="background"/>
+            <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
+            <sizehint height="11un" type="PREFERRED" width="11un"/>
+            <contentsmargins bottom="expr((17un - 11un) / 2)" left="var(hb-param-margin-gene-middle-horizontal)" right="var(hb-param-margin-gene-middle-horizontal)" top="expr((17un - 11un) / 2)"/>
+            <string name="text"/>
+            <bool name="stretched" value="FALSE"/>
+        </widget>
+        <widget name="rightSideLayout" type="HbWidget">
+            <widget name="informationAreaLayout" type="HbWidget">
+                <widget name="twoRowsLayout" type="HbWidget">
+                    <widget name="firstRowLabel" type="HbLabel">
+                        <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+                        <sizehint height="3un" type="PREFERRED" width="32.5un"/>
+                    </widget>
+                    <widget name="secondRowLabel" type="HbLabel">
+                        <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+                        <sizehint height="3un" type="PREFERRED" width="32.5un"/>
+                    </widget>
+                    <real name="z" value="0"/>
+                    <sizehint height="expr(var(hb-param-margin-gene-middle-vertical) + (var(hb-param-text-height-tiny) * 2))" type="PREFERRED" width="31.5un"/>
+                    <bool name="visible" value="FALSE"/>
+                    <layout orientation="Vertical" spacing="var(hb-param-margin-gene-middle-vertical)" type="linear">
+                        <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+                        <linearitem itemname="firstRowLabel" spacing="var(hb-param-margin-gene-middle-vertical)"/>
+                        <linearitem itemname="secondRowLabel" spacing="0un"/>
+                    </layout>
+                </widget>
+                <widget name="oneRowLayout" type="HbWidget">
+                    <widget name="lonelyRowLabel" type="HbLabel">
+                        <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+                        <sizehint height="6.625un" type="PREFERRED" width="32.5un"/>
+                    </widget>
+                    <real name="z" value="0"/>
+                    <sizehint height="expr(var(hb-param-margin-gene-middle-vertical) + (var(hb-param-text-height-tiny) * 2))" type="PREFERRED" width="31.5un"/>
+                    <sizehint type="MINIMUM" width="0.74627un"/>
+                    <bool name="visible" value="FALSE"/>
+                    <layout orientation="Vertical" spacing="0un" type="linear">
+                        <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+                        <linearitem itemname="lonelyRowLabel"/>
+                    </layout>
+                </widget>
+                <widget name="animationLayout" type="HbWidget">
+                    <widget name="animationIcon" type="HbLabel">
+                        <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+                        <sizehint height="var(hb-param-graphic-size-primary-medium)" type="PREFERRED" width="var(hb-param-graphic-size-primary-medium)"/>
+                    </widget>
+                    <real name="z" value="0"/>
+                    <sizehint height="expr(var(hb-param-margin-gene-middle-vertical) + (var(hb-param-text-height-tiny) * 2))" type="PREFERRED" width="31.5un"/>
+                    <bool name="visible" value="FALSE"/>
+                    <layout orientation="Vertical" spacing="0un" type="linear">
+                        <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+                        <linearitem itemname="animationIcon"/>
+                    </layout>
+                </widget>
+                <real name="z" value="0"/>
+                <sizehint height="expr(var(hb-param-margin-gene-middle-vertical) + (var(hb-param-text-height-tiny) * 2))" type="PREFERRED" width="31.5un"/>
+                <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+                <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-tiny)"/>
+                <layout type="stacked">
+                    <stackitem itemname="twoRowsLayout"/>
+                    <stackitem itemname="oneRowLayout"/>
+                    <stackitem itemname="animationLayout"/>
+                </layout>
+            </widget>
+            <widget name="controlAreaLayout" type="HbWidget">
+                <widget name="previousPushButton" type="HbPushButton">
+                    <icon iconName="qtg_mono_previous" name="icon"/>
+                    <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
+                    <sizehint height="8un" type="PREFERRED" width="expr(31.5un /3)"/>
+                    <string name="text"/>
+                    <bool name="enabled" value="FALSE"/>
+                </widget>
+                <widget name="playPushButton" type="HbPushButton">
+                    <icon iconName="qtg_mono_play" name="icon"/>
+                    <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
+                    <sizehint height="8un" type="PREFERRED" width="expr(31.5un /3)"/>
+                    <string name="text"/>
+                    <bool name="enabled" value="FALSE"/>
+                </widget>
+                <widget name="nextPushButton" type="HbPushButton">
+                    <icon iconName="qtg_mono_next" name="icon"/>
+                    <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
+                    <sizehint height="8un" type="PREFERRED" width="expr(31.5un /3)"/>
+                    <string name="text"/>
+                    <bool name="enabled" value="FALSE"/>
+                </widget>
+                <real name="z" value="1"/>
+                <sizehint height="8un" type="PREFERRED" width="31.5un"/>
+                <sizehint height="0un" type="MINIMUM" width="0un"/>
+                <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+                <layout orientation="Horizontal" spacing="0un" type="linear">
+                    <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+                    <linearitem itemname="previousPushButton" spacing="0un"/>
+                    <linearitem itemname="playPushButton" spacing="0un"/>
+                    <linearitem itemname="nextPushButton"/>
+                </layout>
+            </widget>
+            <real name="z" value="0"/>
+            <sizehint height="expr((var(hb-param-margin-gene-middle-vertical) * 4)  + (var(hb-param-text-height-tiny) * 2) + 8un)" type="PREFERRED" width="expr(46un - 11un - 2px - (2 * var(hb-param-margin-gene-middle-horizontal)))"/>
+            <contentsmargins bottom="var(hb-param-margin-gene-middle-vertical)" left="var(hb-param-margin-gene-middle-horizontal)" right="var(hb-param-margin-gene-middle-horizontal)" top="var(hb-param-margin-gene-middle-vertical)"/>
+            <layout orientation="Vertical" spacing="var(hb-param-margin-gene-middle-vertical)" type="linear">
+                <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+                <linearitem itemname="informationAreaLayout" spacing="var(hb-param-margin-gene-middle-vertical)"/>
+                <linearitem itemname="controlAreaLayout" spacing="0un"/>
+            </layout>
+        </widget>
+        <widget name="verticalSeparatorLabel" type="HbLabel">
+            <sizehint height="expr((var(hb-param-margin-gene-middle-vertical) * 4)  + (var(hb-param-text-height-tiny) * 2) + 8un)" type="PREFERRED" width="2"/>
+            <contentsmargins bottom="2" left="0un" right="0un" top="2"/>
+        </widget>
+        <real name="z" value="1"/>
+        <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
+        <sizehint height="expr((var(hb-param-margin-gene-middle-vertical) * 4)  + (var(hb-param-text-height-tiny) * 2) + 8un)" type="PREFERRED" width="46un"/>
+        <layout orientation="Horizontal" spacing="0un" type="linear">
+            <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+            <linearitem itemname="radioIconPushButton" spacing="0un" stretchfactor="-1"/>
+            <linearitem itemname="verticalSeparatorLabel" spacing="0un"/>
+            <linearitem itemname="rightSideLayout" spacing="0un"/>
+        </layout>
+    </widget>
+    <metadata activeUIState="Common ui state" display="NHD landscape" unit="un">
+        <uistate name="Common ui state" sections="#common"/>
+    </metadata>
+</hbdocument>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hswidgetplugin/fmradiohswidgetplugin/resource/fmradiohswidgetplugin.css	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,23 @@
+HbMarqueeItem#marquee1::text {
+    text-height: var(hb-param-text-height-tiny);
+    font-variant: secondary;
+    color: qtc_hs_list_item_title;
+    text-align: center center;
+    text-wrap-mode: no-wrap;
+}
+
+HbMarqueeItem#marquee2::text {
+    text-height: var(hb-param-text-height-tiny);
+    font-variant: secondary;
+    color: qtc_hs_list_item_content;
+    text-align: center center;
+    text-wrap-mode: no-wrap;
+}
+
+HbMarqueeItem#marquee3::text {
+    text-height: var(hb-param-text-height-tiny);
+    font-variant: secondary;
+    color: red;
+    text-align: center center;
+    text-wrap-mode: no-wrap;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hswidgetplugin/fmradiohswidgetplugin/resource/fmradiohswidgetplugin.manifest	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<widgetprovider>
+    <widget library="fmradiohswidgetplugin"
+            uri="fmradiohswidgetplugin"
+            title="#FM Radio Widget"
+            iconuri="fmradiohswidgetplugin_icon.png"
+	    description="FM Radio homescreen widget."/>
+</widgetprovider>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hswidgetplugin/fmradiohswidgetplugin/resource/fmradiohswidgetplugin.s60xml	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<service>
+    <name>fmradiohswidgetplugin</name>
+    <filepath>c:/private/20022F35/import/widgetregistry/2002E6D6/fmradiohswidgetplugin.qtplugin</filepath>
+    <description>FM Radio homescreen widget</description>
+    <interface>
+        <name>com.nokia.IHomeScreenWidget</name>
+        <version>1.0</version>
+        <description>FM Radio homescreen widget</description>
+        <capabilities></capabilities>
+        <customproperty key="iconuri">fmradiohswidgetplugin_icon.png</customproperty>
+        <customproperty key="title">FM Radio Widget</customproperty>
+    </interface>
+</service>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hswidgetplugin/fmradiohswidgetplugin/resource/fmradiohswidgetplugin.xml	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<service>
+    <name>fmradiohswidgetplugin</name>
+    <filepath>fmradiohswidgetplugin</filepath>
+    <description>FM Radio homescreen widget</description>
+    <interface>
+        <name>com.nokia.symbian.IHomeScreenWidget</name>
+        <version>1.0</version>
+        <description>FM Radio homescreen widget</description>
+        <capabilities></capabilities>
+        <customproperty key="iconuri">fmradiohswidgetplugin_icon.png</customproperty>
+        <customproperty key="title">FM Radio Widget</customproperty>
+    </interface>
+</service>
Binary file hswidgetplugin/fmradiohswidgetplugin/resource/fmradiohswidgetplugin_icon.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hswidgetplugin/fmradiohswidgetplugin/resources.qrc	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,6 @@
+<RCC>
+    <qresource prefix="/ui">
+        <file>resource/fmradiohswidget.docml</file>
+        <file>resource/fmradiohswidgetplugin.css</file>
+    </qresource>
+</RCC>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hswidgetplugin/fmradiohswidgetplugin/src/fmradiohswidget.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,925 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  FM Radio home screen widget
+*
+*/
+
+// System includes
+#include <HbPushButton>
+#include <HbLabel>
+#include <HbDocumentLoader>
+#include <HbFrameDrawer>
+#include <HbFrameItem>
+#include <HbIcon>
+#include <HbIconAnimationManager>
+#include <HbIconAnimationDefinition>
+#include <HbColorScheme>
+#include <HbMarqueeItem>
+#include <HbStyleLoader>
+#include <QGraphicsLinearLayout>
+#include <QGraphicsItem>
+#include <QDesktopServices>
+
+// User includes
+#include "fmradiohswidget.h"
+#include "fmradiohswidgetprocesshandler.h"
+#include "fmradiohswidgetprofilereader.h"
+#include "fmradiohswidgetradioserviceclient.h"
+#include "radioservicedef.h"
+#include "radio_global.h"
+
+/*!
+    \ingroup group_fmradiohs_widget
+    \class FmRadioHsWidget
+    \brief Example implementation for home screen widget.
+
+    FmRadioHsWidget derived from the HbWidget and implements 
+    needed functions for the home screen widget. 
+*/
+
+// ======== MEMBER FUNCTIONS ========
+
+/*!
+    Constructs a widget which is a child of \a parent, with widget flags set to \a flags.
+*/
+FmRadioHsWidget::FmRadioHsWidget(QGraphicsItem* parent, Qt::WindowFlags flags)
+    : HbWidget(parent, flags),
+      mRadioPushButton(0),
+      mPreviousPushButton(0),
+      mPlayPushButton(0),
+      mNextPushButton(0),
+      mInformationFirstRowLabel(0),
+      mInformationSecondRowLabel(0),
+      mFmRadioState(Undefined),
+      mPlayButtonState(PlayEnabled),
+      mIsFavoriteChannels(false),
+      mRadioInformation(QHash<QString, QString>()),
+      mProcessHandler(0),
+      mProfileMonitor(new FmRadioHsWidgetProfileReader(this)),
+      mRadioServiceClient(new FmRadioHsWidgetRadioServiceClient(this))
+{
+    connect(mRadioServiceClient, SIGNAL(radioInformationChanged(int, QVariant)), this,
+        SLOT(handleRadioInformationChange(int, QVariant)));
+    connect(mRadioServiceClient, SIGNAL(radioStateChanged(QVariant)), this,
+        SLOT(handleRadioStateChange(QVariant)));
+    connect(mProfileMonitor, SIGNAL(radioRunning(QVariant)), this,
+        SLOT(handleRadioStateChange(QVariant)));
+    
+    load(KDocml);
+    
+    handleRadioStateChange(mProfileMonitor->radioStatus());
+
+    //mRadioServiceClient->init();
+}
+
+/*!
+    Destructor
+*/
+FmRadioHsWidget::~FmRadioHsWidget()
+{
+}
+
+/*!
+    Called when widget is shown in the home screen
+*/
+void FmRadioHsWidget::onShow()
+{
+}
+
+/*!
+    Called when widget is hidden from the home screen
+*/
+void FmRadioHsWidget::onHide()
+{
+}
+
+/*!
+    Loads docml files.
+*/
+void FmRadioHsWidget::load(const QString docml)
+{
+    bool loaded = false;
+
+    HbDocumentLoader *documentLoader = new HbDocumentLoader();
+    documentLoader->reset();
+    documentLoader->load(docml, &loaded);
+
+    if (loaded) {
+        HbWidget *widget = qobject_cast<HbWidget*> (documentLoader->findWidget(
+            KDocmlObjectNameMainLayout));
+
+        HbFrameItem *frameItem = NULL;
+
+        if (widget) {
+            //HbWidget *view = qobject_cast<HbWidget*> (widget);
+            QGraphicsLinearLayout *mWidgetLayout = new QGraphicsLinearLayout(Qt::Vertical, this);
+
+            HbFrameDrawer *drawer = new HbFrameDrawer("qtg_fr_hswidget_normal",
+                HbFrameDrawer::NinePieces);
+            frameItem = new HbFrameItem(drawer, widget);
+            frameItem->setPreferredSize(widget->preferredSize());
+
+            mWidgetLayout->addItem(widget);
+            setLayout(mWidgetLayout);
+        }
+
+        mRadioPushButton = qobject_cast<HbPushButton*> (documentLoader->findWidget(
+            KDocmlObjectNameRadioIconPushButton));
+        if (mRadioPushButton) {
+            if (frameItem) {
+                frameItem->stackBefore(mRadioPushButton);
+            }
+            mRadioPushButton->setBackground(HbIcon("qtg_large_radio"));
+            mRadioPushButton->icon().setSize(mRadioPushButton->preferredSize());
+            QObject::connect(mRadioPushButton, SIGNAL(clicked()), this, SLOT(radioToForeground()));
+        }
+
+        mVerticalSeparatorLabel = qobject_cast<HbLabel*> (documentLoader->findWidget(
+            KDocmlObjectNameVerticalSeparatorLabel));
+        if (mVerticalSeparatorLabel) {
+            mVerticalSeparatorLabel->setIcon(HbIcon("qtg_graf_divider_v_thin"));
+        }
+        
+        HbWidget *controlAreaLayoutWidget = qobject_cast<HbWidget*> (documentLoader->findWidget(
+            KDocmlObjectNameControlAreaLayout));
+        if (controlAreaLayoutWidget) {
+        }
+
+        mPreviousPushButton = qobject_cast<HbPushButton *> (documentLoader->findWidget(
+            KDocmlObjectNamePreviousPushButton));
+        if (mPreviousPushButton) {
+            changeControlButtonFrameBackground(false, Left, mPreviousPushButton);
+/*
+            HbFrameDrawer *previousButtonFrameDrawer = new HbFrameDrawer("qtg_fr_hsbutton_disabled",
+                  HbFrameDrawer::ThreePiecesHorizontal);
+            previousButtonFrameDrawer->setFileNameSuffixList(QStringList() << "_l" << "_c" << "_cr");
+            mPreviousPushButton->setFrameBackground(previousButtonFrameDrawer);
+*/            QObject::connect(mPreviousPushButton, SIGNAL(clicked()), this, SLOT(previousChannel()));
+        }
+
+        mPlayPushButton = qobject_cast<HbPushButton *> (documentLoader->findWidget(
+            KDocmlObjectNamePlayPushButton));
+        if (mPlayPushButton) {
+            changeControlButtonFrameBackground(false, Center, mPlayPushButton);
+/*            HbFrameDrawer *playButtonFrameDrawer = new HbFrameDrawer("qtg_fr_hsbutton_disabled",
+                  HbFrameDrawer::ThreePiecesHorizontal);
+            playButtonFrameDrawer->setFileNameSuffixList(QStringList() << "_cl" << "_c" << "_cr");
+            mPlayPushButton->setFrameBackground(playButtonFrameDrawer);
+*/            QObject::connect(mPlayPushButton, SIGNAL(clicked()), this, SLOT(radioToBackground()));
+        }
+
+        mNextPushButton = qobject_cast<HbPushButton *> (documentLoader->findWidget(
+            KDocmlObjectNameNextPushButton));
+        if (mNextPushButton) {
+            changeControlButtonFrameBackground(false, Right, mNextPushButton);
+/*            HbFrameDrawer *nextButtonFrameDrawer = new HbFrameDrawer("qtg_fr_hsbutton_disabled",
+                  HbFrameDrawer::ThreePiecesHorizontal);
+            nextButtonFrameDrawer->setFileNameSuffixList(QStringList() << "_cl" << "_c" << "_r");
+            mNextPushButton->setFrameBackground(nextButtonFrameDrawer);
+*/            QObject::connect(mNextPushButton, SIGNAL(clicked()), this, SLOT(nextChannel()));
+        }
+        
+        //bool b = QFile::exists(KCss);
+        bool a = HbStyleLoader::registerFilePath(KCss);
+
+        mInformationAreaTwoRowsLayout = qobject_cast<QGraphicsWidget *> (
+            documentLoader->findObject(KDocmlObjectNameTwoRowsLayout));
+        if (mInformationAreaTwoRowsLayout) {
+            /*
+            QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical, mInformationAreaTwoRowsLayout);
+            mInformationFirstRowMarquee = new HbMarqueeItem();
+            HbStyle::setItemName(mInformationFirstRowMarquee, "marquee1");
+            mInformationFirstRowMarquee->setObjectName("marquee1");
+            mInformationFirstRowMarquee->setText(
+                "Long text");
+            mInformationFirstRowMarquee->setLoopCount(-1);
+            mInformationFirstRowMarquee->startAnimation();
+            HbFontSpec fs(HbFontSpec::Secondary);
+            mInformationFirstRowMarquee->setFontSpec(fs);
+            mInformationFirstRowMarquee->setTextColor(HbColorScheme::color("qtc_hs_list_item_title"));
+            mInformationFirstRowMarquee->setPreferredSize(layout->preferredSize());
+            layout->addItem(mInformationFirstRowMarquee);
+         
+            mInformationSecondRowMarquee = new HbMarqueeItem();
+            mInformationSecondRowMarquee->setObjectName("marquee2");
+            mInformationSecondRowMarquee->setText(
+                "Long text to test marquee, Long text to test marquee");
+            mInformationSecondRowMarquee->setLoopCount(-1);
+            mInformationSecondRowMarquee->startAnimation();
+            mInformationSecondRowMarquee->setFontSpec(fs);
+            mInformationSecondRowMarquee->setTextColor(HbColorScheme::color("qtc_hs_list_item_title"));
+            mInformationSecondRowMarquee->setPreferredSize(layout->preferredSize());
+            layout->addItem(mInformationSecondRowMarquee);
+            */
+        }
+
+        mInformationAreaOneRowLayout = qobject_cast<QGraphicsWidget *> (documentLoader->findObject(
+            KDocmlObjectNameOneRowLayout));
+        if (mInformationAreaOneRowLayout) {
+            /*
+            QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical, mInformationAreaOneRowLayout);
+            mInformationLonelyRowMarquee = new HbMarqueeItem();
+            mInformationLonelyRowMarquee->setObjectName("marquee3");
+            HbStyle::setItemName(mInformationLonelyRowMarquee, "marquee3");
+            mInformationLonelyRowMarquee->setText(
+                "Long text");
+            mInformationLonelyRowMarquee->setLoopCount(-1);
+            mInformationLonelyRowMarquee->startAnimation();
+            HbFontSpec fs(HbFontSpec::Secondary);
+            mInformationLonelyRowMarquee->setFontSpec(fs);
+            mInformationLonelyRowMarquee->setTextColor(HbColorScheme::color("qtc_hs_list_item_title"));
+            mInformationLonelyRowMarquee->setPreferredSize(layout->preferredSize());
+            layout->addItem(mInformationLonelyRowMarquee);
+            */
+        }
+
+        mInformationAreaAnimationLayout = qobject_cast<QGraphicsWidget *> (
+            documentLoader->findObject(QString(KDocmlObjectNameAnimationLayout)));
+        if (mInformationAreaAnimationLayout) {
+        }
+        
+        mInformationFirstRowLabel = qobject_cast<HbLabel *> (documentLoader->findWidget(
+            KDocmlObjectNameFirstRowLabel));
+        if (mInformationFirstRowLabel) {
+            mInformationFirstRowLabel->setTextColor(HbColorScheme::color("qtc_hs_list_item_title"));
+        }
+
+        mInformationSecondRowLabel = qobject_cast<HbLabel *> (documentLoader->findWidget(
+            KDocmlObjectNameSecondRowLabel));
+        if (mInformationSecondRowLabel) {
+            mInformationSecondRowLabel->setTextColor(HbColorScheme::color("qtc_hs_list_item_content"));
+        }
+
+        mInformationLonelyRowLabel = qobject_cast<HbLabel *> (documentLoader->findWidget(
+            KDocmlObjectNameLonelyRowLabel));
+        if (mInformationLonelyRowLabel) {
+            mInformationLonelyRowLabel->setTextColor(HbColorScheme::color("qtc_hs_list_item_content"));
+        }
+
+        mAnimationIcon = qobject_cast<HbLabel *> (documentLoader->findWidget(
+            KDocmlObjectNameAnimationIcon));
+        if (mAnimationIcon) {
+            // Use animation manager to define the frame-by-frame animation.
+            HbIconAnimationManager *animationManager = HbIconAnimationManager::global();
+
+            // Create animation definition.
+            HbIconAnimationDefinition animationDefinition;
+            QList<HbIconAnimationDefinition::AnimationFrame> animationFrameList;
+
+            HbIconAnimationDefinition::AnimationFrame animationFrame;
+            QString animationFrameIconName;
+            QString animationFrameIconNamePrefix = "qtg_anim_loading_";
+            for (int i = 1; i < 11; i++) {
+                animationFrame.duration = 100;
+                animationFrameIconName.clear();
+                animationFrameIconName.append(animationFrameIconNamePrefix);
+                animationFrameIconName.append(animationFrameIconName.number(i));
+                animationFrame.iconName = animationFrameIconName;
+                animationFrameList.append(animationFrame);
+            }
+            animationDefinition.setPlayMode(HbIconAnimationDefinition::Loop);
+            animationDefinition.setFrameList(animationFrameList);
+            animationManager->addDefinition("animation", animationDefinition);
+
+            // Construct an icon using the animation definition.
+            HbIcon icon("animation");
+            
+            mAnimationIcon->setIcon(icon);
+        }
+
+    }
+    delete documentLoader;
+}
+
+/*!
+ Slot for grouping events.
+ */
+bool FmRadioHsWidget::eventFilter(QObject */*target*/, QEvent */*event*/)
+ {
+// This event filter is used to get events from information area layout and from it's components.
+// Not yet implemented.   
+/*
+    if (target == mFrequencyLabel) {
+        if (event->type() == QEvent::MouseButtonRelease) {
+            qDebug() << "MouseButtonRelease";
+            return true;
+        }
+        else if (event->type() == QEvent::MouseButtonPress) {
+            qDebug() << "MouseButtonPress";
+            return true;
+        }
+        else if (event->type() == QEvent::KeyPress) {
+            qDebug() << "KeyPress";
+            return true;
+        }
+        else {
+            return false;
+        }
+    }
+    else {
+        // pass the event on to the parent class
+        return HbWidget::eventFilter(target, event);
+    }
+*/
+    return false;
+}
+
+/*!
+ Mute FM Radio audio.
+ */
+void FmRadioHsWidget::mute()
+{
+    mRadioServiceClient->doControlFmRadioAudio(FmRadioHsWidgetRadioServiceClient::Mute);
+    //handleRadioStateChange(QVariant(NotControllingAudio));
+}
+
+/*!
+ Unmute FM Radio audio.
+ */
+void FmRadioHsWidget::unMute()
+{
+    mRadioServiceClient->doControlFmRadioAudio(FmRadioHsWidgetRadioServiceClient::Unmute);
+    //handleRadioStateChange(QVariant(ControllingAudio));
+}
+
+/*!
+ Slot for previous button clicked.
+ */
+void FmRadioHsWidget::previousChannel()
+{
+    mRadioServiceClient->doChangeFmRadioChannel(FmRadioHsWidgetRadioServiceClient::PreviousFavouriteChannel);
+}
+
+/*!
+ Slot for next button clicked.
+ */
+void FmRadioHsWidget::nextChannel()
+{
+    mRadioServiceClient->doChangeFmRadioChannel(FmRadioHsWidgetRadioServiceClient::NextFavouriteChannel);
+}
+
+/*!
+ Slot for radio button clicked.
+ */
+void FmRadioHsWidget::radioToForeground()
+{
+    if (mFmRadioState == NotRunning) {
+        handleRadioStateChange(QVariant(Starting));
+        mRadioServiceClient->startMonitoring(FmRadioHsWidgetRadioServiceClient::ToForeground);
+    }
+    else {
+        mRadioServiceClient->doChangeFmRadioVisibility(
+            FmRadioHsWidgetRadioServiceClient::ToForeground);
+    }
+}
+
+/*!
+ Slot for radio button clicked.
+ */
+void FmRadioHsWidget::radioToBackground()
+{
+    if (mFmRadioState == NotRunning) {
+        handleRadioStateChange(QVariant(Starting));
+        mRadioServiceClient->startMonitoring(FmRadioHsWidgetRadioServiceClient::ToBackground);
+    }
+    else if (mFmRadioState == Starting) {
+        
+    }
+    else {
+        mRadioServiceClient->doChangeFmRadioVisibility(
+            FmRadioHsWidgetRadioServiceClient::ToBackground);
+    }
+}
+
+/*!
+ Opening of url to the browser.
+ 
+ /param url Url to be opened.
+ */
+bool FmRadioHsWidget::openUrl(QUrl url)
+{
+    return QDesktopServices::openUrl(url);
+}
+
+/*!
+ Handles changes in FM Radio information.
+ 
+ /param type Type of changed information.
+ /param value Information content.
+ */
+void FmRadioHsWidget::handleRadioInformationChange(
+    int notificationId, QVariant value)
+{
+    if (!value.isValid()) {
+        return;
+    }
+    switch ( notificationId ) {
+
+        case RadioServiceNotification::FavoriteCount:
+            if (value.canConvert(QVariant::Int)) {
+                int favoriteCount = value.toInt();
+                mIsFavoriteChannels = favoriteCount > 0 ? true : false;
+                changeChannelButtonsEnabledState(mIsFavoriteChannels);
+            }
+            break;
+
+        case RadioServiceNotification::RadioStatus:
+            if (value.canConvert(QVariant::Int)) {
+                int status = value.toInt();
+                switch (status) {
+                case RadioStatus::Playing:
+                    handleRadioStateChange(QVariant(ControllingAudio));
+                    break;
+                case RadioStatus::Muted:
+                    handleRadioStateChange(QVariant(NotControllingAudio));
+                    break;
+                case RadioStatus::Seeking:
+                    handleRadioStateChange(QVariant(Seeking));
+                    break;
+                case RadioStatus::NoAntenna:
+                    handleRadioStateChange(QVariant(AntennaNotConnected));
+                    break;                    
+                default:
+                    break;
+                }
+            }
+            break;
+
+        case RadioServiceNotification::Frequency:
+            if (value.canConvert(QVariant::UInt)) {
+                const uint frequency = value.toUInt();
+                QString freqString;
+                freqString.sprintf("%.1f", qreal(frequency) / KFrequencyMultiplier);
+                bool frequencyCleared = false;
+                if (mRadioInformation.contains(KRadioInformationFrequency)
+                    && mRadioInformation[KRadioInformationFrequency].compare(freqString) != 0) {
+                    clearRadioInformation();
+                    frequencyCleared = true;
+                }
+                bool frequencyUpdated = updateRadioInformation(KRadioInformationFrequency, freqString);
+                if (frequencyCleared || frequencyUpdated) {
+                    radioInformationChanged();
+                }
+            }
+        break;
+
+        case RadioServiceNotification::Name:
+            if (value.canConvert(QVariant::String)) {
+                if (updateRadioInformation(KRadioInformationStationName, value.toString())) {
+                    radioInformationChanged();
+                }
+            }
+        break;
+
+        case RadioServiceNotification::Genre:
+            if (value.canConvert(QVariant::String)) {
+                if (updateRadioInformation(KRadioInformationPty, value.toString())) {
+                    radioInformationChanged();
+                }
+            }
+        break;
+
+        case RadioServiceNotification::RadioText:
+            if (value.canConvert(QVariant::String)) {
+                if (updateRadioInformation(KRadioInformationRt, value.toString())) {
+                    radioInformationChanged();
+                }
+            }
+        break;
+
+        case RadioServiceNotification::HomePage:
+            if (value.canConvert(QVariant::String)) {
+                if (updateRadioInformation(KRadioInformationHomePage, value.toString())) {
+                    radioInformationChanged();
+                }
+            }
+        break;
+        
+        case RadioServiceNotification::Song:
+            if (value.canConvert(QVariant::String)) {
+                if (updateRadioInformation(KRadioInformationSong, value.toString())) {
+                    radioInformationChanged();
+                }
+            }
+        break;
+
+
+/*    case FmRadioHsWidgetRadioServiceClient::InformationTypeCallSign:
+        if (updateRadioInformation(KRadioInformationCallSign, informationText)) {
+
+        }
+        break;
+*/
+/*    case FmRadioHsWidgetRadioServiceClient::InformationTypeDynamicPsName:
+        if (updateRadioInformation(KRadioInformationDynamicPsName,
+            informationText)) {
+
+        }
+        break;
+        */
+        
+    default:
+        break;
+    }
+}
+
+/*!
+ Check if the the radio information is changed. If it is changed update it.
+ 
+ /param informationType Type of the information. 
+ /param information  Information text.
+ 
+ /return bool If information is updated, return true. Return false otherwise.
+ */
+bool FmRadioHsWidget::updateRadioInformation(const QString informationType, QString information)
+{
+    // If hash contains this type
+    if (mRadioInformation.contains(informationType)) {
+        // If new information is empty
+        if (information.isEmpty()) {
+            // Remove it from the hash
+            mRadioInformation.remove(informationType);
+            // Return true to indicate the change
+            return true;
+        }
+        // If new information differs from the old one
+        if (mRadioInformation[informationType].compare(information) != 0) {
+            // Update the information
+            mRadioInformation[informationType] = information;
+            // And return true to indicate the change
+            return true;
+        }
+    } else { // Hash do not contain the information
+        // If new information is not empty
+        if (!information.isEmpty()) {
+            // Add it to the hash
+            mRadioInformation[informationType] = information;
+            // Return true to indicate the change
+            return true;
+        }
+    }
+    // Return false to indicate that nothing changed
+    return false;
+}
+
+/*!
+ Formatting radio information texts after change. 
+ */
+void FmRadioHsWidget::radioInformationChanged()
+{
+    mRadioInformationFirstRow = "";
+    mRadioInformationSecondRow = "";
+
+    // Lets formulate the first row, first station name
+    if (mRadioInformation.contains(KRadioInformationStationName)) {
+        mRadioInformationFirstRow.append(mRadioInformation.value(KRadioInformationStationName));
+    }
+    // Second call sign
+    if (mRadioInformation.contains(KRadioInformationCallSign)) {
+        mRadioInformationFirstRow.append(" " + mRadioInformation.value(KRadioInformationCallSign));
+    }
+    // Third frequency
+    if (mRadioInformation.contains(KRadioInformationFrequency)) {
+        mRadioInformationFirstRow.append(" " + mRadioInformation.value(KRadioInformationFrequency)
+            + " " + KMhzText);
+    }
+    // Second row of information contains first rt
+    if (mRadioInformation.contains(KRadioInformationRt)) {
+        mRadioInformationSecondRow.append(mRadioInformation.value(KRadioInformationRt));
+    }
+    // Second is dynamic ps name
+    if (mRadioInformation.contains(KRadioInformationDynamicPsName)) {
+        mRadioInformationSecondRow.append(" " + mRadioInformation.value(
+            KRadioInformationDynamicPsName));
+    }
+    // Third is pty 
+    if (mRadioInformation.contains(KRadioInformationPty)) {
+        mRadioInformationSecondRow.append(" " + mRadioInformation.value(KRadioInformationPty));
+    }
+
+    if (mRadioInformationSecondRow.isEmpty()) {
+        mInformationLonelyRowLabel->setPlainText(mRadioInformationFirstRow);
+        changeInformationAreaLayout(OneRow);
+    }
+    else {
+        mInformationFirstRowLabel->setPlainText(mRadioInformationFirstRow);
+        mInformationSecondRowLabel->setPlainText(mRadioInformationSecondRow);
+        changeInformationAreaLayout(TwoRows);
+    }
+}
+
+/*!
+ Clears the radio station information. For example, when the channel is
+ changed, old information should be cleared.
+ */
+void FmRadioHsWidget::clearRadioInformation()
+{
+    if (!mRadioInformation.isEmpty()) {
+        mRadioInformation.clear();
+    }
+}
+
+/*!
+ Handles changes in FM Radio state.
+ 
+ /param value Information content.
+ */
+void FmRadioHsWidget::handleRadioStateChange(QVariant value)
+{
+    int state;
+    if (value.canConvert(QVariant::Int)) {
+        state = value.toInt();
+    } else {
+        return;
+    }
+    
+    if (state == mFmRadioState) {
+        // State did not change, so return.
+        return;
+    }
+    
+    switch (state) {
+    case Undefined:
+        // TODO: Some error occured because we do not have the state information. Handle this.
+        mFmRadioState = Undefined;
+        break;
+    case NotRunning:
+        mFmRadioState = NotRunning;
+        mRadioServiceClient->stopMonitoring();
+        //changeControlButtonState(ChannelsDisabledPlay);
+        QObject::disconnect(mPlayPushButton, SIGNAL(clicked()), this,
+            SLOT(unMute()));
+        QObject::disconnect(mPlayPushButton, SIGNAL(clicked()), this,
+            SLOT(mute()));
+        QObject::connect(mPlayPushButton, SIGNAL(clicked()), this,
+            SLOT(radioToBackground()));
+        changePlayButtonState(PlayEnabled);
+        mIsFavoriteChannels = false;
+        changeChannelButtonsEnabledState(false);
+        mInformationFirstRowLabel->setPlainText("");
+        mInformationSecondRowLabel->setPlainText("");
+        mInformationLonelyRowLabel->setPlainText(KFmRadioText);
+        changeInformationAreaLayout(OneRow);
+        break;
+    case Starting:
+        mFmRadioState = Starting;
+        //changeControlButtonState(ChannelsDisabledStop);
+        changePlayButtonState(StopDisabled);
+        // TODO: What should the stop button do? Should it close the radio?
+        changeChannelButtonsEnabledState(false);
+        changeInformationAreaLayout(Animation);
+        break;
+    case Running:
+        mFmRadioState = Running;
+        mRadioServiceClient->startMonitoring(FmRadioHsWidgetRadioServiceClient::DoNotChange);
+        //changeControlButtonState(ChannelsEnabledStop);
+        QObject::disconnect(mPlayPushButton, SIGNAL(clicked()), this,
+            SLOT(radioToBackground()));
+        QObject::disconnect(mPlayPushButton, SIGNAL(clicked()), this,
+            SLOT(unMute()));
+        QObject::connect(mPlayPushButton, SIGNAL(clicked()), this,
+            SLOT(mute()));
+        changePlayButtonState(StopEnabled);
+        changeChannelButtonsEnabledState(mIsFavoriteChannels);
+        changeInformationAreaLayout(OneRow);
+        break;
+    case ControllingAudio:
+        mFmRadioState = ControllingAudio;
+        //changeControlButtonState(ChannelsEnabledStop);
+        QObject::disconnect(mPlayPushButton, SIGNAL(clicked()), this,
+            SLOT(radioToBackground()));
+        QObject::disconnect(mPlayPushButton, SIGNAL(clicked()), this,
+            SLOT(unMute()));
+        QObject::connect(mPlayPushButton, SIGNAL(clicked()), this,
+            SLOT(mute()));
+        changePlayButtonState(StopEnabled);
+        changeChannelButtonsEnabledState(mIsFavoriteChannels);
+        radioInformationChanged();
+        break;
+    case NotControllingAudio:
+        mFmRadioState = NotControllingAudio;
+        //changeControlButtonState(ChannelsEnabledPlay);
+        QObject::disconnect(mPlayPushButton, SIGNAL(clicked()), this,
+            SLOT(radioToBackground()));
+        QObject::disconnect(mPlayPushButton, SIGNAL(clicked()), this,
+            SLOT(mute()));
+        QObject::connect(mPlayPushButton, SIGNAL(clicked()), this,
+            SLOT(unMute()));
+        changePlayButtonState(PlayEnabled);
+        changeChannelButtonsEnabledState(mIsFavoriteChannels);
+        radioInformationChanged();
+        break;
+    case Seeking:
+        mFmRadioState = Seeking;
+        //changeControlButtonState(AllDisabledStop);
+        changePlayButtonState(StopDisabled);
+        changeChannelButtonsEnabledState(false);
+        changeInformationAreaLayout(Animation);
+        break;
+    case AntennaNotConnected:
+        mFmRadioState = AntennaNotConnected;
+        //changeControlButtonState(AllDisabledPlay);
+        changePlayButtonState(StopDisabled);
+        changeChannelButtonsEnabledState(false);
+        mInformationFirstRowLabel->setPlainText("");
+        mInformationSecondRowLabel->setPlainText("");
+        mInformationLonelyRowLabel->setPlainText(KConnectHeadsetText);
+        changeInformationAreaLayout(OneRow);
+        break;
+    default:
+        break;
+    }
+}
+
+/*!
+ Changes visible layout of information area.
+ 
+ /param InformationAreaLayout The layout to switch visible.
+ */
+void FmRadioHsWidget::changeInformationAreaLayout(InformationAreaLayout layout)
+{
+    switch (layout) {
+    case OneRow:
+        mInformationAreaOneRowLayout->show();
+        ((QGraphicsWidget*) mInformationAreaTwoRowsLayout)->hide();
+        mInformationAreaAnimationLayout->hide();
+        break;
+    case TwoRows:
+        mInformationAreaOneRowLayout->hide();
+        ((QGraphicsWidget*) mInformationAreaTwoRowsLayout)->show();
+        mInformationAreaAnimationLayout->hide();
+        break;
+    case Animation:
+        mInformationAreaOneRowLayout->hide();
+        ((QGraphicsWidget*) mInformationAreaTwoRowsLayout)->hide();
+        mInformationAreaAnimationLayout->show();
+        break;
+    default:
+        break;
+    }
+}
+
+/*!
+ Changes state of the control buttons.
+ 
+ /param ControlButtonState State of the control buttons.
+ */
+void FmRadioHsWidget::changeControlButtonState(ControlButtonState buttonState)
+{
+    QString iconName;
+    switch (buttonState) {
+    case AllDisabledPlay:
+        changeControlButtonFrameBackground(false, Left, mPreviousPushButton);
+        iconName.append("qtg_mono_play");
+        mPlayPushButton->setIcon(HbIcon(iconName));
+        changeControlButtonFrameBackground(false, Center, mPlayPushButton);
+        changeControlButtonFrameBackground(false, Right, mNextPushButton);
+        break;
+    case AllDisabledStop:
+        changeControlButtonFrameBackground(false, Left, mPreviousPushButton);
+        iconName.append("qtg_mono_stop");
+        mPlayPushButton->setIcon(HbIcon(iconName));
+        changeControlButtonFrameBackground(false, Center, mPlayPushButton);
+        changeControlButtonFrameBackground(false, Right, mNextPushButton);
+        break;
+    case ChannelsDisabledPlay:
+        changeControlButtonFrameBackground(false, Left, mPreviousPushButton);
+        QObject::disconnect(mPlayPushButton, SIGNAL(clicked()), this,
+            SLOT(unMute()));
+        QObject::disconnect(mPlayPushButton, SIGNAL(clicked()), this,
+            SLOT(mute()));
+        QObject::connect(mPlayPushButton, SIGNAL(clicked()), this,
+            SLOT(radioToBackground()));
+        iconName.append("qtg_mono_play");
+        mPlayPushButton->setIcon(HbIcon(iconName));
+        changeControlButtonFrameBackground(true, Center, mPlayPushButton);
+        changeControlButtonFrameBackground(false, Right, mNextPushButton);
+        break;
+    case ChannelsDisabledStop:
+        changeControlButtonFrameBackground(false, Left, mPreviousPushButton);
+        iconName.append("qtg_mono_stop");
+        mPlayPushButton->setIcon(HbIcon(iconName));
+        changeControlButtonFrameBackground(true, Center, mPlayPushButton);
+        changeControlButtonFrameBackground(false, Right, mNextPushButton);
+        break;
+    case ChannelsEnabledPlay:
+        changeControlButtonFrameBackground(true, Left, mPreviousPushButton);
+        QObject::disconnect(mPlayPushButton, SIGNAL(clicked()), this,
+            SLOT(radioToBackground()));
+        QObject::disconnect(mPlayPushButton, SIGNAL(clicked()), this,
+            SLOT(mute()));
+        QObject::connect(mPlayPushButton, SIGNAL(clicked()), this,
+            SLOT(unMute()));
+        iconName.append("qtg_mono_play");
+        mPlayPushButton->setIcon(HbIcon(iconName));
+        changeControlButtonFrameBackground(true, Center, mPlayPushButton);
+        changeControlButtonFrameBackground(true, Right, mNextPushButton);
+        break;
+    case ChannelsEnabledStop:
+        changeControlButtonFrameBackground(true, Left, mPreviousPushButton);
+        QObject::disconnect(mPlayPushButton, SIGNAL(clicked()), this,
+            SLOT(radioToBackground()));
+        QObject::disconnect(mPlayPushButton, SIGNAL(clicked()), this,
+            SLOT(unMute()));
+        QObject::connect(mPlayPushButton, SIGNAL(clicked()), this,
+            SLOT(mute()));
+        iconName.append("qtg_mono_stop");
+        mPlayPushButton->setIcon(HbIcon(iconName));
+        changeControlButtonFrameBackground(true, Center, mPlayPushButton);
+        changeControlButtonFrameBackground(true, Right, mNextPushButton);
+        break;
+    default:
+        break;
+    }
+}
+
+/*!
+ Changes enabled state of channel buttons.
+ 
+ */
+void FmRadioHsWidget::changePlayButtonState(PlayButtonState buttonState)
+{
+    QString iconName;
+    bool enabled = false;
+    switch (buttonState) {
+    case PlayDisabled:
+        iconName.append("qtg_mono_play");
+        mPlayPushButton->setIcon(HbIcon(iconName));
+        enabled = false;
+        break;
+    case PlayEnabled:
+        iconName.append("qtg_mono_play");
+        mPlayPushButton->setIcon(HbIcon(iconName));
+        enabled = true;
+        break;
+    case StopDisabled:
+        iconName.append("qtg_mono_stop");
+        mPlayPushButton->setIcon(HbIcon(iconName));
+        enabled = false;
+        break;
+    case StopEnabled:
+        iconName.append("qtg_mono_stop");
+        mPlayPushButton->setIcon(HbIcon(iconName));
+        enabled = true;
+        break;
+    default:
+        break;
+    }
+    changeControlButtonFrameBackground(enabled, Center, mPlayPushButton);
+}
+
+/*!
+ Changes enabled state of channel buttons.
+ 
+ */
+void FmRadioHsWidget::changeChannelButtonsEnabledState(bool enabled)
+{
+    changeControlButtonFrameBackground(enabled, Left, mPreviousPushButton);
+    changeControlButtonFrameBackground(enabled, Right, mNextPushButton);
+}
+
+/*!
+ Changes background of control button.
+ 
+ /param enabled Is button enabled or disabled.
+ /param position Position of the control button in button group.
+ /param button The button to change the background.
+ */
+void FmRadioHsWidget::changeControlButtonFrameBackground(bool enabled,
+    ControlButtonPosition position, HbPushButton *button)
+{
+    QString frameGraphicsName("qtg_fr_hsbutton_");
+    if (enabled) {
+        frameGraphicsName.append("normal");
+    } else {
+        frameGraphicsName.append("disabled");
+    }
+    HbFrameDrawer *frameDrawer = new HbFrameDrawer(frameGraphicsName,
+        HbFrameDrawer::ThreePiecesHorizontal);
+    switch (position) {
+    case Left:
+        frameDrawer->setFileNameSuffixList(QStringList() << "_l" << "_c" << "_cr");
+        break;
+    case Center:
+        frameDrawer->setFileNameSuffixList(QStringList() << "_cl" << "_c" << "_cr");
+        break;
+    case Right:
+        frameDrawer->setFileNameSuffixList(QStringList() << "_cl" << "_c" << "_r");
+        break;
+    default:
+        break;
+    }
+    button->setFrameBackground(frameDrawer);
+    button->setEnabled(enabled);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hswidgetplugin/fmradiohswidgetplugin/src/fmradiohswidgetplugin.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  FM Radio home screen widget plugin
+*
+*/
+
+#include <qserviceinterfacedescriptor.h>
+#include <qabstractsecuritysession.h>
+#include <qservicecontext.h>
+
+#include "fmradiohswidgetplugin.h"
+#include "fmradiohswidget.h"
+
+   
+/*!
+    Initialize plugin for FM Radio home screen widget. Contains necessary information about 
+    the fm radio widget that it can be loaded through QT Service Framework.
+*/
+QObject *FmRadioHsWidgetPlugin::createInstance(const QServiceInterfaceDescriptor &descriptor,
+                                             QServiceContext *context,
+                                             QAbstractSecuritySession *session)
+{
+    Q_UNUSED(context);
+    Q_UNUSED(session);
+
+    if (descriptor.interfaceName() == QLatin1String("com.nokia.symbian.IHomeScreenWidget")) {
+        return new FmRadioHsWidget();
+    } else {
+        return 0;
+    }
+}
+
+Q_EXPORT_PLUGIN2(fmradiohswidgetplugin, FmRadioHsWidgetPlugin)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hswidgetplugin/fmradiohswidgetplugin/src/fmradiohswidgetprocesshandler.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,119 @@
+/*
+* 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: FM Radio widget process handler
+*
+*/
+
+// System includes
+
+// User includes
+#include "fmradiohswidgetprocesshandler.h"
+#include "fmradiohswidget.h"
+
+/*!
+ Constructor
+ */
+FmRadioHsWidgetProcessHandler::FmRadioHsWidgetProcessHandler(QObject *parent) :
+    QObject(parent), mProcess(new QProcess(this))
+{
+    QObject::connect(mProcess, SIGNAL(stateChanged(QProcess::ProcessState)),
+        this, SLOT(handleStateChange(QProcess::ProcessState)));
+    QObject::connect(mProcess, SIGNAL(error(QProcess::ProcessError error)),
+        this, SLOT(handleError(QProcess::ProcessError error)));
+    QObject::connect(mProcess,
+        SIGNAL(finished(int exitCode, QProcess::ExitStatus exitStatus)),
+        this,
+        SLOT(handleFinish(int exitCode, QProcess::ExitStatus exitStatus)));
+}
+
+/*!
+ Destructor 
+ */
+FmRadioHsWidgetProcessHandler::~FmRadioHsWidgetProcessHandler()
+{
+}
+
+/*!
+ Launching of FM Radio application process. 
+ */
+void FmRadioHsWidgetProcessHandler::startFmRadioApplication()
+{
+    if (mProcess->pid() == qint64(0)) {
+        QString executablePath = KRadioExecutablePath;
+        QStringList arguments;
+        arguments << KRadioExecutableArguments;
+        mProcess->start(executablePath, arguments);
+    }
+}
+
+/*!
+ Handles state change notifications from FM Radio application process. 
+ */
+void FmRadioHsWidgetProcessHandler::handleStateChange(
+    QProcess::ProcessState state)
+{
+    switch (state) {
+    case QProcess::NotRunning:
+        emit fmRadioApplicationStateChanged(QVariant(FmRadioHsWidget::NotRunning));
+        break;
+    case QProcess::Starting:
+        emit fmRadioApplicationStateChanged(QVariant(FmRadioHsWidget::Starting));
+        break;
+    case QProcess::Running:
+        emit fmRadioApplicationStateChanged(QVariant(FmRadioHsWidget::Running));
+        break;
+    default:
+        break;
+    }
+}
+
+/*!
+ Handles error notifications from FM Radio application process. 
+ */
+void FmRadioHsWidgetProcessHandler::handleError(
+    QProcess::ProcessError error)
+{
+    switch (error) {
+    case QProcess::FailedToStart:
+        break;
+    case QProcess::Crashed:
+        break;
+    case QProcess::Timedout:
+        break;
+    case QProcess::WriteError:
+        break;
+    case QProcess::ReadError:
+        break;
+    case QProcess::UnknownError:
+        break;
+    default:
+        break;
+    }
+}
+
+/*!
+ Handles finished process notifications from FM Radio application process. 
+ */
+void FmRadioHsWidgetProcessHandler::handleFinish(int /*exitCode*/,
+    QProcess::ExitStatus exitStatus)
+{
+    switch (exitStatus) {
+    case QProcess::NormalExit:
+        break;
+    case QProcess::CrashExit:
+        break;
+    default:
+        break;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hswidgetplugin/fmradiohswidgetplugin/src/fmradiohswidgetprofilereader.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,168 @@
+/*
+* 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: FM Radio widget process handler
+*
+*/
+
+// System includes
+#include <ProfileEngineSDKCRKeys.h>
+#include "xqsettingsmanager.h"
+#include "xqsettingskey.h"
+#include "xqpublishandsubscribeutils.h"
+#include <QDateTime>
+
+// User includes
+#include "fmradiohswidgetprofilereader.h"
+#include "fmradiohswidget.h"
+#include "radioservicedef.h"
+
+/*!
+ Constructor
+ */
+FmRadioHsWidgetProfileReader::FmRadioHsWidgetProfileReader(QObject *parent) :
+    QObject(parent),
+    mSettingsManager(new XQSettingsManager(this)),
+    mRadioStatus(-1)
+{
+/*
+    // Monitors devices profile.
+    XQSettingsKey profileKey(XQSettingsKey::TargetCentralRepository,
+        KCRUidProfileEngine.iUid, KProEngActiveProfile);
+    mSettingsManager->startMonitoring(profileKey);
+    currentProfileStatus(mSettingsManager->readItemValue(profileKey));
+    
+    connect(mSettingsManager, SIGNAL(itemDeleted(XQSettingsKey)), this,
+        SLOT(itemDeleted(XQSettingsKey)));
+    connect(mSettingsManager, SIGNAL(valueChanged(XQSettingsKey, QVariant)),
+        this, SLOT(handleChanges(XQSettingsKey, QVariant)));
+*/
+    startMonitoringRadioRunningStatus();
+    bool d = connect(mSettingsManager, SIGNAL(itemDeleted(XQSettingsKey)), this,
+        SLOT(itemDeleted(XQSettingsKey)));
+    bool h = connect(mSettingsManager, SIGNAL(valueChanged(XQSettingsKey, QVariant)),
+        this, SLOT(handleRadioRunningChanges(XQSettingsKey, QVariant)));
+}
+
+/*!
+ Destructor 
+ */
+FmRadioHsWidgetProfileReader::~FmRadioHsWidgetProfileReader()
+{
+}
+
+
+/*!
+ Handling of deletion of listened P&S key.
+ 
+ \param key Deleted key.
+ */
+void FmRadioHsWidgetProfileReader::itemDeleted(const XQSettingsKey& key)
+{
+/*
+    if (key.uid() == KCRUidProfileEngine.iUid && key.key()
+        == KProEngActiveProfile) {
+    }
+*/
+    if (key.uid() == KRadioPSUid && key.key() == KRadioStartupKey) {
+        startMonitoringRadioRunningStatus();
+    }
+}
+
+/*!
+ Notifications from settings manager are handled and routed to appropriate
+ private slots.
+
+ \param key Changed key.
+ \param value Value of changed key.
+ */
+/*
+void FmRadioHsWidgetProfileReader::handleChanges(const XQSettingsKey& key,
+    const QVariant& value)
+{ 
+    if (key.uid() == KCRUidProfileEngine.iUid && key.key()
+        == KProEngActiveProfile) {
+        currentProfileStatus(value);
+    }
+}
+*/
+
+/*!
+ Handling changes in profile information.
+ 
+ \param value Originally information is of int type. Valid values after
+ conversion are described by KProEngActiveProfile in ProfileEngineSDKCRKeys.h.
+ */
+void FmRadioHsWidgetProfileReader::currentProfileStatus(QVariant value)
+{
+    if (value.canConvert(QVariant::Int)) {
+        emit profileChanged(value.toInt());
+    }
+}
+
+/*!
+ Notifications from settings manager are handled and routed to appropriate
+ private slots.
+
+ \param key Changed key.
+ \param value Value of changed key.
+ */
+void FmRadioHsWidgetProfileReader::handleRadioRunningChanges(const XQSettingsKey& key,
+    const QVariant& value)
+{
+    if (key.uid() == KRadioPSUid && key.key()
+        == KRadioStartupKey) {
+        currentRadioRunningStatus(value);
+    }
+}
+
+/*!
+ Handling changes in profile information.
+ 
+ \param value Originally information is of int type. Valid values after
+ conversion are described by KProEngActiveProfile in ProfileEngineSDKCRKeys.h.
+ */
+void FmRadioHsWidgetProfileReader::currentRadioRunningStatus(QVariant value)
+{
+    if (value.isValid()) {
+        if (value.canConvert(QVariant::Int)) {
+            mRadioStatus = value.toInt();
+            QVariant state(FmRadioHsWidget::Running);
+            emit radioRunning(state);
+        }
+    } else {
+        mRadioStatus = -1;
+        QVariant state(FmRadioHsWidget::NotRunning);
+        emit radioRunning(state);
+    }
+}
+
+QVariant FmRadioHsWidgetProfileReader::radioStatus()
+{
+    QVariant state;
+    if (mRadioStatus != -1) {
+        state = QVariant(FmRadioHsWidget::Running);
+        return state;
+    } else {
+        state = QVariant(FmRadioHsWidget::NotRunning);
+        return state;
+    }
+}
+
+void FmRadioHsWidgetProfileReader::startMonitoringRadioRunningStatus()
+{
+    XQSettingsKey radioRunningKey(XQSettingsKey::TargetPublishAndSubscribe, KRadioPSUid,
+        KRadioStartupKey);
+    bool a = mSettingsManager->startMonitoring(radioRunningKey);
+    currentRadioRunningStatus(mSettingsManager->readItemValue(radioRunningKey));
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hswidgetplugin/fmradiohswidgetplugin/src/fmradiohswidgetradioserviceclient.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,497 @@
+/*
+* 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: FM Radio widget radio service client
+*
+*/
+
+// System includes
+#include <xqserviceglobal.h>
+
+// User includes
+#include "fmradiohswidgetradioserviceclient.h"
+#include "fmradiohswidget.h"
+#include "radioservicedef.h"
+#include "radionotificationdata.h"
+
+/*!
+ Constructor
+ */
+FmRadioHsWidgetRadioServiceClient::FmRadioHsWidgetRadioServiceClient(QObject *parent) :
+    QObject(parent),
+    mRequestPending(false),
+    mRadioMonitorRequest(0),
+    mRadioControlRequest(0),
+    mDataInitialized(false)
+{
+}
+
+/*!
+ Destructor 
+ */
+FmRadioHsWidgetRadioServiceClient::~FmRadioHsWidgetRadioServiceClient()
+{
+    stopMonitoring();
+}
+
+/*!
+ * Initialize all data
+ */
+void FmRadioHsWidgetRadioServiceClient::init()
+{
+    const bool radioIsRunning = false; //TODO: Find out if radio is running. Use P&S key for now
+    if ( radioIsRunning ) {
+        //startMonitoring();
+    }
+}
+
+
+/*!
+ Starting of FM Radio.
+ 
+ /param startupState 
+ */
+/*
+void FmRadioHsWidgetRadioServiceClient::doStartFmRadio(FmRadioStartupState startupState)
+{
+    if (!mRadioControlRequest) {
+        createControlServiceRequest();
+    }
+
+    QVariant commandArgument;
+    switch (startupState) {
+    case StartForeground:
+        // TODO: Include header and remove comment.
+        commandArgument.setValue(*//*RadioServiceCommand::Foreground*/ //6);
+/*        break;
+    case StartBackground:
+        // TODO: Include header and remove comment.
+        commandArgument.setValue(*//*RadioServiceCommand::Background*/ //7);
+/*        break;
+    default:
+        break;
+    }
+    QList<QVariant> arguments;
+    arguments.append(commandArgument);
+    mRadioControlRequest->setArguments(arguments);
+
+    bool res = mRadioControlRequest->send();
+}
+*/
+/*!
+ Bring FM Radio to foreground.
+ 
+ */
+void FmRadioHsWidgetRadioServiceClient::doChangeFmRadioVisibility(FmRadioVisibilty visibility)
+{
+    QVariant commandArgument;
+    switch (visibility) {
+    case ToForeground:
+        commandArgument.setValue((int) RadioServiceCommand::Foreground);
+        break;
+    case ToBackground:
+        commandArgument.setValue((int) RadioServiceCommand::Background);
+    case DoNotChange:
+    default:
+        break;
+    }
+    doSendControlRequest(commandArgument, visibility);
+}
+
+/*!
+ Changing of FM Radio channel.
+ 
+ /param command Command to execute.
+ */
+void FmRadioHsWidgetRadioServiceClient::doChangeFmRadioChannel(
+    FmRadioChannelChangeCommand command)
+{
+    QVariant commandArgument;
+    switch (command) {
+    case PreviousFavouriteChannel:
+        commandArgument.setValue((int) RadioServiceCommand::Previous);
+        break;
+    case NextFavouriteChannel:
+        commandArgument.setValue((int) RadioServiceCommand::Next);
+        break;
+    default:
+        break;
+    }
+    doSendControlRequest(commandArgument, DoNotChange);
+}
+
+/*!
+ Changing of FM Radio channel.
+ 
+ /param command Command to execute.
+ */
+void FmRadioHsWidgetRadioServiceClient::doControlFmRadioAudio(
+    FmRadioAudioControlCommand command)
+{
+    QVariant commandArgument;
+    switch (command) {
+    case Mute:
+        commandArgument.setValue((int) RadioServiceCommand::Pause);
+        break;
+    case Unmute:
+        commandArgument.setValue((int) RadioServiceCommand::Play);
+        break;
+    default:
+        break;
+    }
+    doSendControlRequest(commandArgument, DoNotChange);
+}
+
+/*!
+ Start FM Radio information listening.
+ */
+void FmRadioHsWidgetRadioServiceClient::doSendControlRequest(QVariant &argument,
+    FmRadioVisibilty visibility)
+{
+    if (!mRadioControlRequest) {
+        createControlServiceRequest();
+    }
+
+    QList<QVariant> arguments;
+    arguments.append(argument);
+    mRadioControlRequest->setArguments(arguments);
+    
+    prepareRequestInfo(mRadioControlRequest, visibility);
+
+    bool res = mRadioControlRequest->send();
+
+    if (!res) {
+        int error = mRadioControlRequest->lastError();
+        handleRequestError(error);
+    }
+    
+    //stopMonitoring();
+    //startMonitoring();
+}
+
+/*!
+ Start FM Radio information listening.
+ */
+void FmRadioHsWidgetRadioServiceClient::doSendMonitorRequest(FmRadioVisibilty visibility)
+{
+    prepareRequestInfo(mRadioMonitorRequest, visibility);
+    if (!mRequestPending) {
+        //FmRadioHsWidgetRadioServiceSingleton::instance()->sendRequest();
+        mRequestPending = mRadioMonitorRequest->send();
+    }
+}
+
+/*!
+ Handle changes in FM Radio information texts.
+ 
+ /param value
+ */
+void FmRadioHsWidgetRadioServiceClient::handleFmRadioInformationChange(const QVariant& value)
+{
+    mRequestPending = false;
+    if (!mDataInitialized) {
+        mRadioMonitorRequest->setOperation(KRadioServiceMonitorOperation);
+        mDataInitialized = true;
+    }
+    startMonitoring(DoNotChange);
+    if ( value.isValid() && value.canConvert( QVariant::List ) ) {
+        QVariantList notificationList = value.toList();
+        foreach ( const QVariant& variant, notificationList ) {
+            RadioNotificationData notification = variant.value<RadioNotificationData>();
+            const int notificationId = notification.mType;
+            emit radioInformationChanged( notificationId, notification.mData );
+        }
+    }
+}
+
+/*!
+ Handles request error.
+ 
+ /param int Error value.
+ */
+void FmRadioHsWidgetRadioServiceClient::handleRequestError(int error)
+{
+    QString errorStr;
+    QVariant var(FmRadioHsWidget::NotRunning);
+    switch (error) {
+    case XQService::ENoError:
+        errorStr = "No error";
+        break;
+    case XQService::EConnectionError:
+        errorStr = "(/*!< Error in IPC Connection */";
+        break;
+    case XQService::EConnectionClosed:
+        errorStr = "/*!< IPC Connection is closed */";
+        stopMonitoring();
+        handleFmRadioStateChange(var);
+        break;
+    case XQService::EServerNotFound:
+        errorStr = "/*!< Can not find server */";
+        break;
+    case XQService::EIPCError:
+        errorStr = "/*!< Known IPC error defined by SDK */";
+        break;
+    case XQService::EUnknownError:
+        errorStr = "/*!< Unknown IPC error */";
+        break;
+    case XQService::ERequestPending:
+        errorStr = "/*!< Already pending request */";
+        break;
+    default:
+        break;
+    }
+}
+
+/*!
+ Handle changes in FM Radio state.
+ 
+ /param value New state of FM Radio.
+ */
+void FmRadioHsWidgetRadioServiceClient::handleFmRadioStateChange(QVariant& value)
+{
+    if (value.isValid()) {
+        emit radioStateChanged(value);
+    }
+}
+
+/*!
+ Handle request completion.
+ 
+ /param value
+ */
+void FmRadioHsWidgetRadioServiceClient::requestCompleted(const QVariant& value)
+{
+    if (value.isValid()) {
+    }
+}
+
+/*!
+ Handle error.
+ 
+ /param errorCode
+ /param errorMessage
+ */
+void FmRadioHsWidgetRadioServiceClient::handleError(int errorCode, const QString& errorMessage)
+{
+    int e = errorCode;
+    QString em = errorMessage;
+    handleRequestError(e);
+}
+
+/*!
+ Creates control service request object.
+ */
+void FmRadioHsWidgetRadioServiceClient::createControlServiceRequest()
+{
+    if (!mRadioControlRequest) {
+        QString fullInterfaceName = /*KRadioServiceName +"."+*/ KRadioServiceControlInterfaceName;
+        mRadioControlRequest = mApplicationManager.create(fullInterfaceName,
+            KRadioServiceControlOperation, false);
+
+        if (mRadioControlRequest) {
+            mRadioControlRequest->setEmbedded(false);
+            mRadioControlRequest->setSynchronous(true);
+            //TODO: Do backgound set through XQRequestInfo in MCL wk14.
+            //mRadioControlRequest->setBackground(true);
+
+            /*
+            bool b = connect(mRadioControlRequest, SIGNAL(requestOk(const QVariant&)), this,
+                SLOT(requestCompleted(const QVariant&)));
+            bool t = connect(mRadioControlRequest, SIGNAL(requestError(int,const QString&)), this,
+                SLOT(handleError(int,const QString&)));
+            */
+        }
+    }
+}
+
+/*!
+ Creates monitor service request object.
+ */
+void FmRadioHsWidgetRadioServiceClient::createMonitorServiceRequest()
+{
+    if (!mRadioMonitorRequest) {
+		QString operation = mDataInitialized ? KRadioServiceMonitorOperation
+            : KRadioServiceRefreshOperation;
+        QString fullInterfaceName = /*KRadioServiceName +"."+*/ KRadioServiceMonitorInterfaceName;
+        
+        /*
+        QList<XQAiwInterfaceDescriptor> list;
+        list = mApplicationManager.list(KRadioServiceName, fullInterfaceName, "");
+        XQAiwInterfaceDescriptor interfaceDescriptor;
+        foreach (XQAiwInterfaceDescriptor d, list)
+            {
+                QString in = d.interfaceName();
+                QString sn = d.serviceName();
+                if (sn == KRadioServiceName && in == fullInterfaceName) {
+                    interfaceDescriptor = d;
+                }
+            }
+        */
+        
+        /*
+        mRadioMonitorRequest = mApplicationManager.create(interfaceDescriptor,
+            KRadioServiceMonitorOperation, false);
+        */
+
+        mRadioMonitorRequest = mApplicationManager.create(
+            fullInterfaceName, operation, false);
+
+        if (mRadioMonitorRequest) {
+            connect(mRadioMonitorRequest, SIGNAL(requestOk(const QVariant&)),
+                this, SLOT(handleFmRadioInformationChange(const QVariant&)));
+            connect(mRadioMonitorRequest,
+                SIGNAL(requestError(int,const QString&)), this,
+                SLOT(handleError(int,const QString&)));
+
+            mRadioMonitorRequest->setSynchronous(false);
+            mRadioMonitorRequest->setEmbedded(false);
+        }
+    }
+}
+
+/*!
+ Start radio monitoring.
+ */
+void FmRadioHsWidgetRadioServiceClient::startMonitoring(FmRadioVisibilty visibility)
+{
+    //FmRadioHsWidgetRadioServiceSingleton::instance(this)->requestNotifications(this);
+
+    if (!mRadioMonitorRequest) {
+        createMonitorServiceRequest();
+    }
+    doSendMonitorRequest(visibility);
+}
+
+/*!
+ Stops radio monitoring.
+ */
+void FmRadioHsWidgetRadioServiceClient::stopMonitoring()
+{
+    //FmRadioHsWidgetRadioServiceSingleton::instance(this)->cancelNotifications(this);
+
+    if (mRadioMonitorRequest) {
+        delete mRadioMonitorRequest;
+        mRadioMonitorRequest = NULL;
+    }
+    mRequestPending = false;
+    mDataInitialized = false;
+}
+
+/*!
+ Prepares the visibility of the request.
+ */
+void FmRadioHsWidgetRadioServiceClient::prepareRequestInfo(XQAiwRequest *request,
+    FmRadioVisibilty visibility)
+{
+    XQRequestInfo info;
+    switch (visibility) {
+    case ToForeground:
+        //info.setForeground(true);
+        break;
+    case ToBackground:
+        info.setBackground(true);
+        break;
+    case DoNotChange:
+    default:
+        break;
+    }
+    if (request) {
+        request->setInfo(info);
+        bool a = request->isBackground();
+    }
+    //bool f = info.isForeground();
+    bool b = info.isBackground();
+}
+
+void FmRadioHsWidgetRadioServiceClient::test()
+{
+    // Test is kept for example. We have to switch to use the XQAiwRequest and this includes workin example code. 
+    //XQAiwRequest* req;
+/*
+    QUrl uri("application://101FF976");
+    QString a = "Uri=" + uri.toString();
+    if (uri.isValid()) {
+        QString b = "isValid";
+    }
+    QString c = "Uri authority=" + uri.authority();
+*/
+/*
+    QList<XQAiwInterfaceDescriptor> list = mApplicationManager.list(KRadioServiceName, KRadioServiceMonitorInterfaceName);
+    foreach (XQAiwInterfaceDescriptor d, list) {
+        QString in = d.interfaceName();
+        QString sn = d.serviceName();
+    }
+
+    list = mApplicationManager.list(KRadioServiceName, KRadioServiceMonitorInterfaceName, "");
+    foreach (XQAiwInterfaceDescriptor d, list) {
+        QString in = d.interfaceName();
+        QString sn = d.serviceName();
+    }
+
+    list = mApplicationManager.list(KRadioServiceMonitorInterfaceName, "");
+    foreach (XQAiwInterfaceDescriptor d, list) {
+        QString in = d.interfaceName();
+        QString sn = d.serviceName();
+    }
+*/
+    //req = mApplicationManager.create(uri, false);
+
+    /*req = mApplicationManager.create(KRadioServiceMonitorInterfaceName, KRadioServiceMonitorOperation,
+        false);*/
+
+/* ///
+    if (!mRadioMonitorRequest) {
+        createMonitorServiceRequest();
+    }
+    bool res = mRadioMonitorRequest->send();
+///
+*/
+    
+    /*if (req) {*/
+/*
+        // Connect signals once
+        bool a = connect(req, SIGNAL(requestOk(const QVariant&)), this,
+            SLOT(handleOk(const QVariant&)));
+        bool b = connect(req, SIGNAL(requestError(int,const QString&)), this,
+            SLOT(handleError(int,const QString&)));
+*/
+        /*bool b = connect(req, SIGNAL(requestOk(const QVariant&)), this,
+            SLOT(handleFmRadioInformationChange(QVariant)));
+        bool c = connect(req, SIGNAL(requestError(int,const QString&)), this,
+            SLOT(handleError(int,const QString&)));*/
+/*
+        QList<QVariant> arg;
+        arg << "";
+        req->setArguments(arg);
+*/
+/*
+        QString op = req->operation();
+        req->setOperation(KRadioServiceMonitorOperation);
+        op = req->operation();
+*/
+        /*bool res = req->send();*/
+
+        /*if (res) {
+            //QTimer::singleShot(40000, this, SLOT(doSendMonitorRequest()));
+        }
+        else {
+            // Request failed.
+            int x = 2;
+        }
+
+    }
+    else {
+        int r;
+        r = 5;
+    }*/
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hswidgetplugin/fmradiohswidgetplugin_exports_to_rom.pri	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,38 @@
+#
+# 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:
+#
+
+BLD_INF_RULES.prj_exports += \
+"$${LITERAL_HASH}include <platform_paths.hrh>"
+
+#iby exports to core
+BLD_INF_RULES.prj_exports += \
+"rom/fmradiohswidgetplugin.iby  CORE_APP_LAYER_IBY_EXPORT_PATH(fmradiohswidgetplugin.iby)"
+
+#iby exports to install
+BLD_INF_RULES.prj_exports += \
+"rom/fmradiohswidgetplugininstaller.iby  CORE_APP_LAYER_IBY_EXPORT_PATH(fmradiohswidgetplugininstaller.iby)"
+
+#iby exports to language
+#BLD_INF_RULES.prj_exports += \
+#"rom/homescreenapp_resources.iby  LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(homescreenapp_resources.iby)"
+
+BLD_INF_RULES.prj_extensions += \
+$$LITERAL_HASH"ifdef MARM" \
+  " START EXTENSION app-services/buildstubsis" \
+    " OPTION SRCDIR rom" \
+    " OPTION SISNAME fmradiohswidgetplugin_stub" \
+  " END" \
+$$LITERAL_HASH"endif"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hswidgetplugin/fmradiohswidgetplugininstaller/fmradiohswidgetplugininstaller.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Example of home screen widget
+*
+*/
+
+#include <qservicemanager.h>
+#include <QCoreApplication>
+#include <QFile>
+
+QTM_USE_NAMESPACE
+
+const QString KXml = "c:/private/20022F35/import/widgetregistry/2002E6D6/fmradiohswidgetplugin.xml";
+
+int main(int argc, char *argv[])
+{
+    QCoreApplication app(argc, argv);
+
+    QServiceManager s;
+
+	if (QFile::exists(KXml)) {
+        s.addService(KXml);
+	} else {
+		s.removeService("fmradiohswidgetplugin");
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hswidgetplugin/fmradiohswidgetplugininstaller/fmradiohswidgetplugininstaller.pro	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,31 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: Example of home screen widget
+#
+
+include(../buildflags.pri)
+
+TEMPLATE = app
+
+QT = core
+CONFIG += no_icon
+
+CONFIG += mobility
+MOBILITY = serviceframework
+
+SOURCES += fmradiohswidgetplugininstaller.cpp
+
+symbian {    
+    TARGET.CAPABILITY = ALL -TCB
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hswidgetplugin/hswidgetplugin.pro	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,22 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: Example of home screen widget
+#
+
+CONFIG += ordered
+TEMPLATE = subdirs
+SUBDIRS = fmradiohswidgetplugin \
+          fmradiohswidgetplugininstaller
+
+symbian:include(fmradiohswidgetplugin_exports_to_rom.pri)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hswidgetplugin/rom/fmradiohswidgetplugin.iby	Fri Jun 04 10:21:36 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 __FMRADIOHSWIDGETPLUGIN_IBY__
+#define __FMRADIOHSWIDGETPLUGIN_IBY__
+
+file=ABI_DIR\BUILD_DIR\fmradiohswidgetplugin.dll                                            SHARED_LIB_DIR\fmradiohswidgetplugin.dll
+data=ZPRIVATE\20022f35\import\widgetregistry\2002E6D6\fmradiohswidgetplugin.qtplugin        private\20022f35\import\widgetregistry\2002E6D6\fmradiohswidgetplugin.qtplugin
+data=ZPRIVATE\20022f35\import\widgetregistry\2002E6D6\fmradiohswidgetplugin.manifest        private\20022f35\import\widgetregistry\2002E6D6\fmradiohswidgetplugin.manifest
+data=ZPRIVATE\20022f35\import\widgetregistry\2002E6D6\fmradiohswidgetplugin.xml             private\20022f35\import\widgetregistry\2002E6D6\fmradiohswidgetplugin.xml
+
+
+#endif //__FMRADIOHSWIDGETPLUGIN_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hswidgetplugin/rom/fmradiohswidgetplugin_stub.pkg	Fri Jun 04 10:21:36 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: Stub package file for FM Radio home screen widget
+;
+
+; Languages
+&EN
+
+; Header
+#{"fmradiohswidgetplugin"}, (0x2002E6D6), 1, 0, 0, TYPE=SA
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hswidgetplugin/rom/fmradiohswidgetplugininstaller.iby	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,23 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef __FMRADIOHSWIDGETPLUGININSTALLER_IBY__
+#define __FMRADIOHSWIDGETPLUGININSTALLER_IBY__
+
+S60_APP_EXE(fmradiohswidgetplugininstaller)
+
+#endif //__FMRADIOHSWIDGETPLUGININSTALLER_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hswidgetplugin/sis/fmradiohswidgetplugin.pkg	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,45 @@
+;
+; Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:
+;
+
+; Language
+&EN
+
+; SIS header: name, uid, version
+#{"fmradiohswidgetplugin"},(0x2002E6D6),1,0,0
+
+; Localised Vendor name
+%{"Vendor"}
+
+; Unique Vendor name
+:"Vendor"
+
+; Manual PKG pre-rules from PRO files
+; Default HW/platform dependencies
+[0x101F7961],0,0,0,{"S60ProductID"}
+[0x102032BE],0,0,0,{"S60ProductID"}
+[0x102752AE],0,0,0,{"S60ProductID"}
+[0x1028315F],0,0,0,{"S60ProductID"}
+ 
+"/epoc32/release/armv5/urel/fmradiohswidgetplugin.dll"                                           - "c:/sys/bin/fmradiohswidgetplugin.dll"
+"../fmradiohswidgetplugin/qmakepluginstubs/fmradiohswidgetplugin.qtplugin"  - "c:/private/20022F35/import/widgetregistry/2002E6D6/fmradiohswidgetplugin.qtplugin"
+"../fmradiohswidgetplugin/resource/fmradiohswidgetplugin.manifest"  - "c:/private/20022F35/import/widgetregistry/2002E6D6/fmradiohswidgetplugin.manifest"
+"../fmradiohswidgetplugin/resource/fmradiohswidgetplugin.s60xml"       - "c:/private/20022F35/import/widgetregistry/2002E6D6/fmradiohswidgetplugin.xml"
+"../fmradiohswidgetplugin/resource/fmradiohswidgetplugin.css"       - "c:/private/20022F35/import/widgetregistry/2002E6D6/fmradiohswidgetplugin.css"
+;"/epoc32/data/z/private/20022F35/import/widgetregistry/2002E6D6/fmradiohswidgetplugin.s60xml"       - "c:/private/20022F35/import/widgetregistry/2002E6D6/fmradiohswidgetplugin.xml"
+;"../fmradiohswidgetplugin/resource/fmradiohswidgetplugin.xml"       - "c:/private/20022F35/import/widgetregistry/2002E6D6/fmradiohswidgetplugin.xml"
+;"../fmradiohswidgetplugin/resource/fmradiohswidgetplugin_icon.png"    - "!:\private\20022F35\import\widgetregistry\2002E6D6\fmradiohswidgetplugin_icon.png"
+
+"/epoc32/release/armv5/urel/fmradiohswidgetplugininstaller.exe"                                  - "c:/sys/bin/fmradiohswidgetplugininstaller.exe", FR, RB, RW
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/layers.sysdef.xml	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<!DOCTYPE SystemDefinition SYSTEM "sysdef_1_5_1.dtd" [
+  <!ENTITY layer_real_source_path "sf/app/radio" >
+]>
+
+<SystemDefinition name="radio" schema="1.5.1">
+  <systemModel>
+    <layer name="app_layer">
+      <module name="radio">
+        <unit unitID="vado.radio" mrp="" bldFile="&layer_real_source_path;" name="radio" proFile="radio.pro" qmakeArgs="-r" />        
+      </module>
+    </layer>
+  </systemModel>
+</SystemDefinition>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radio.pro	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,24 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+TEMPLATE = subdirs
+CONFIG += ordered
+
+symbian: {
+    BLD_INF_RULES.prj_mmpfiles += $$LITERAL_HASH"include \"radioengine/group/bld.inf\""
+    SUBDIRS += radioapp
+    SUBDIRS += hswidgetplugin
+}
\ No newline at end of file
Binary file radioapp/bin/fmradio_en_US.qm has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/buildflags.pri	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,114 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+
+# ##########################################################
+# Start of Flag definitions
+# Add or remove comments to disable or enable the features
+# ##########################################################
+
+# Use of some debugging controls that are not part of official UI spec
+# RADIOFLAGS += USE_DEBUGGING_CONTROLS
+
+# Reads the layout docml files and images from e:/radiotest/ folder
+# RADIOFLAGS += USE_LAYOUT_FROM_E_DRIVE
+
+# Flag to use dummy radio data read from XML file
+# RADIOFLAGS += USE_DUMMY_RADIO_DATA
+
+# Functional testing
+# RADIOFLAGS += SHOW_CALLSIGN_IN_ANY_REGION
+
+# Build flag to enable usage of the new preset utility
+RADIOFLAGS += COMPILE_WITH_NEW_PRESET_UTILITY
+
+# Build flag to add EXPORTUNFROZEN to the pro file
+# RADIOFLAGS += USE_UNFROZEN_EXPORTS
+
+# Enables the assert macros
+# RADIOFLAGS += ENABLE_ASSERTS
+
+# ##########################################################
+# Start of Logging flag definitions
+# ##########################################################
+
+# Full logging flag that enables the full logging including also timestamps
+# Enabled by default in debug builds
+ CONFIG(debug, debug|release) : LOGGING_FLAGS += LOGGING_ENABLED
+
+# Uncomment to enable full logging in release builds
+# LOGGING_FLAGS *= LOGGING_ENABLED
+
+# Timestamp logging flag that enables only timestamp logging
+# LOGGING_FLAGS += TIMESTAMP_LOGGING_ENABLED
+
+# Combines Ui and Engine logs by feeding UI traces to the engine logger
+LOGGING_FLAGS += COMBINE_WITH_ENGINE_LOGGER
+
+contains(LOGGING_FLAGS, TIMESTAMP_LOGGING_ENABLED)|contains(LOGGING_FLAGS, LOGGING_ENABLED) {
+
+    # Writes debug prints to file if enabled
+    #LOGGING_FLAGS += TRACE_TO_FILE
+
+    # Settings for the log file name
+    symbian:contains(LOGGING_FLAGS, TRACE_TO_FILE) {
+        LOGGING_FLAGS += \"TRACE_OUTPUT_FILE=\\\"c:/logs/radio/fmradioui.txt\\\"\"
+        LOGGING_FLAGS += FILTER_BY_LOGMARKER=true
+    }
+}
+
+# Method for testing signal-slot connections
+# 1 - Log failed connection
+# 2 - Log failed connection and halt debugger
+LOGGING_FLAGS += CONNECT_TEST_MODE=2
+
+DEFINES += $$LOGGING_FLAGS
+
+# ##########################################################
+# End of Flag definitions
+# ##########################################################
+
+# Copy all radio flags to defines to define them as preprocessor macros
+DEFINES += $$RADIOFLAGS
+CONFIG += $$RADIOFLAGS
+CONFIG += $$LOGGING_FLAGS
+
+symbian: {
+    DEFINES += SYMBIAN
+    TARGET.EPOCALLOWDLLDATA = 1
+    TARGET.VID              = VID_DEFAULT
+    TARGET.CAPABILITY       = CAP_GENERAL_DLL
+}
+
+win32: {
+    DEFINES     += BUILD_WIN32
+    DESTDIR     = ../bin
+    LIBS        += -L../bin
+    INCLUDEPATH += ../radioenginewrapper/inc
+}
+
+USE_UNFROZEN_EXPORTS {
+    symbian:MMP_RULES   +=  "exportunfrozen"
+    symbian:DEF_FILE    = not_used.def
+}
+
+# $$_PRO_FILE_PWD_ points to the directory of the pro file
+MOC_DIR         = $$_PRO_FILE_PWD_/tmp
+RCC_DIR         = $$_PRO_FILE_PWD_/tmp
+OBJECTS_DIR     = $$_PRO_FILE_PWD_/tmp
+UI_DIR          = $$_PRO_FILE_PWD_/tmp
+UI_HEADERS_DIR  = $$_PRO_FILE_PWD_/tmp
+UI_SOURCES_DIR  = $$_PRO_FILE_PWD_/tmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/bwins/radioenginewrapperu.def	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,41 @@
+EXPORTS
+	?skipPrevious@RadioEngineWrapperObserver@@UAEXXZ @ 1 NONAME ; void RadioEngineWrapperObserver::skipPrevious(void)
+	?volumeChanged@RadioEngineWrapperObserver@@UAEXH@Z @ 2 NONAME ; void RadioEngineWrapperObserver::volumeChanged(int)
+	?settings@RadioEngineWrapper@@QAEAAVRadioSettingsIf@@XZ @ 3 NONAME ; class RadioSettingsIf & RadioEngineWrapper::settings(void)
+	?region@RadioEngineWrapper@@QBE?AW4Region@RadioRegion@@XZ @ 4 NONAME ; enum RadioRegion::Region RadioEngineWrapper::region(void) const
+	?tuneFrequency@RadioEngineWrapper@@QAEXIH@Z @ 5 NONAME ; void RadioEngineWrapper::tuneFrequency(unsigned int, int)
+	?initCombinedLogger@RadioLogger@@SAXXZ @ 6 NONAME ; void RadioLogger::initCombinedLogger(void)
+	?removeObserver@RadioEngineWrapper@@QAEXPAVRadioEngineWrapperObserver@@@Z @ 7 NONAME ; void RadioEngineWrapper::removeObserver(class RadioEngineWrapperObserver *)
+	?startSeeking@RadioEngineWrapper@@QAEXW4Direction@Seeking@@H@Z @ 8 NONAME ; void RadioEngineWrapper::startSeeking(enum Seeking::Direction, int)
+	?isRadioOn@RadioEngineWrapper@@QBE_NXZ @ 9 NONAME ; bool RadioEngineWrapper::isRadioOn(void) const
+	?addObserver@RadioEngineWrapper@@QAEXPAVRadioEngineWrapperObserver@@@Z @ 10 NONAME ; void RadioEngineWrapper::addObserver(class RadioEngineWrapperObserver *)
+	?isAntennaAttached@RadioEngineWrapper@@QBE_NXZ @ 11 NONAME ; bool RadioEngineWrapper::isAntennaAttached(void) const
+	?isEngineConstructed@RadioEngineWrapper@@QAE_NXZ @ 12 NONAME ; bool RadioEngineWrapper::isEngineConstructed(void)
+	?toggleAudioRoute@RadioEngineWrapper@@QAEXXZ @ 13 NONAME ; void RadioEngineWrapper::toggleAudioRoute(void)
+	?setVolume@RadioEngineWrapper@@QAEXH@Z @ 14 NONAME ; void RadioEngineWrapper::setVolume(int)
+	??0RadioEngineWrapper@@QAE@AAVRadioStationHandlerIf@@@Z @ 15 NONAME ; RadioEngineWrapper::RadioEngineWrapper(class RadioStationHandlerIf &)
+	?cancelSeeking@RadioEngineWrapper@@QAEXXZ @ 16 NONAME ; void RadioEngineWrapper::cancelSeeking(void)
+	?d_func@RadioEngineWrapper@@AAEPAVRadioEngineWrapperPrivate@@XZ @ 17 NONAME ; class RadioEngineWrapperPrivate * RadioEngineWrapper::d_func(void)
+	?d_func@RadioEngineWrapper@@ABEPBVRadioEngineWrapperPrivate@@XZ @ 18 NONAME ; class RadioEngineWrapperPrivate const * RadioEngineWrapper::d_func(void) const
+	?setMute@RadioEngineWrapper@@QAEX_N@Z @ 19 NONAME ; void RadioEngineWrapper::setMute(bool)
+	?releaseCombinedLogger@RadioLogger@@SAXXZ @ 20 NONAME ; void RadioLogger::releaseCombinedLogger(void)
+	??1RadioEngineWrapper@@QAE@XZ @ 21 NONAME ; RadioEngineWrapper::~RadioEngineWrapper(void)
+	?radioStatusChanged@RadioEngineWrapperObserver@@UAEX_N@Z @ 22 NONAME ; void RadioEngineWrapperObserver::radioStatusChanged(bool)
+	?frequencyStepSize@RadioEngineWrapper@@QBEIXZ @ 23 NONAME ; unsigned int RadioEngineWrapper::frequencyStepSize(void) const
+	??0MethodLogger@@QAE@PBD0@Z @ 24 NONAME ; MethodLogger::MethodLogger(char const *, char const *)
+	?logMsg@RadioLogger@@SAXPBDW4Mode@1@@Z @ 25 NONAME ; void RadioLogger::logMsg(char const *, enum RadioLogger::Mode)
+	?audioRouteChanged@RadioEngineWrapperObserver@@UAEX_N@Z @ 26 NONAME ; void RadioEngineWrapperObserver::audioRouteChanged(bool)
+	?isMuted@RadioEngineWrapper@@QBE_NXZ @ 27 NONAME ; bool RadioEngineWrapper::isMuted(void) const
+	?isUsingLoudspeaker@RadioEngineWrapper@@QBE_NXZ @ 28 NONAME ; bool RadioEngineWrapper::isUsingLoudspeaker(void) const
+	?currentFrequency@RadioEngineWrapper@@QBEIXZ @ 29 NONAME ; unsigned int RadioEngineWrapper::currentFrequency(void) const
+	?skipNext@RadioEngineWrapperObserver@@UAEXXZ @ 30 NONAME ; void RadioEngineWrapperObserver::skipNext(void)
+	?muteChanged@RadioEngineWrapperObserver@@UAEX_N@Z @ 31 NONAME ; void RadioEngineWrapperObserver::muteChanged(bool)
+	?isFrequencyValid@RadioEngineWrapper@@QAE_NI@Z @ 32 NONAME ; bool RadioEngineWrapper::isFrequencyValid(unsigned int)
+	?minFrequency@RadioEngineWrapper@@QBEIXZ @ 33 NONAME ; unsigned int RadioEngineWrapper::minFrequency(void) const
+	?rdsAvailabilityChanged@RadioEngineWrapperObserver@@UAEX_N@Z @ 34 NONAME ; void RadioEngineWrapperObserver::rdsAvailabilityChanged(bool)
+	?tunedToFrequency@RadioEngineWrapperObserver@@UAEXIH@Z @ 35 NONAME ; void RadioEngineWrapperObserver::tunedToFrequency(unsigned int, int)
+	?tuneWithDelay@RadioEngineWrapper@@QAEXIH@Z @ 36 NONAME ; void RadioEngineWrapper::tuneWithDelay(unsigned int, int)
+	??1MethodLogger@@QAE@XZ @ 37 NONAME ; MethodLogger::~MethodLogger(void)
+	?antennaStatusChanged@RadioEngineWrapperObserver@@UAEX_N@Z @ 38 NONAME ; void RadioEngineWrapperObserver::antennaStatusChanged(bool)
+	?maxFrequency@RadioEngineWrapper@@QBEIXZ @ 39 NONAME ; unsigned int RadioEngineWrapper::maxFrequency(void) const
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/bwins/radiopresetstorageu.def	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,13 @@
+EXPORTS
+	??1RadioPresetStorage@@QAE@XZ @ 1 NONAME ; RadioPresetStorage::~RadioPresetStorage(void)
+	?savePreset@RadioPresetStorage@@QAE_NABVRadioStationIf@@@Z @ 2 NONAME ; bool RadioPresetStorage::savePreset(class RadioStationIf const &)
+	?maxNumberOfPresets@RadioPresetStorage@@QBEHXZ @ 3 NONAME ; int RadioPresetStorage::maxNumberOfPresets(void) const
+	??0RadioPresetStorage@@QAE@XZ @ 4 NONAME ; RadioPresetStorage::RadioPresetStorage(void)
+	?nextPreset@RadioPresetStorage@@QBEHH@Z @ 5 NONAME ; int RadioPresetStorage::nextPreset(int) const
+	?deletePreset@RadioPresetStorage@@QAE_NH@Z @ 6 NONAME ; bool RadioPresetStorage::deletePreset(int)
+	?firstPreset@RadioPresetStorage@@QBEHXZ @ 7 NONAME ; int RadioPresetStorage::firstPreset(void) const
+	?readPreset@RadioPresetStorage@@QAE_NHAAVRadioStationIf@@@Z @ 8 NONAME ; bool RadioPresetStorage::readPreset(int, class RadioStationIf &)
+	?presetCount@RadioPresetStorage@@QBEHXZ @ 9 NONAME ; int RadioPresetStorage::presetCount(void) const
+	?d_func@RadioPresetStorage@@AAEPAVRadioPresetStoragePrivate@@XZ @ 10 NONAME ; class RadioPresetStoragePrivate * RadioPresetStorage::d_func(void)
+	?d_func@RadioPresetStorage@@ABEPBVRadioPresetStoragePrivate@@XZ @ 11 NONAME ; class RadioPresetStoragePrivate const * RadioPresetStorage::d_func(void) const
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/bwins/radiouiengineu.def	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,279 @@
+EXPORTS
+	?setFrequency@RadioHistoryItem@@QAEXI@Z @ 1 NONAME ; void RadioHistoryItem::setFrequency(unsigned int)
+	?qt_metacast@RadioUiEngine@@UAEPAXPBD@Z @ 2 NONAME ; void * RadioUiEngine::qt_metacast(char const *)
+	?index@RadioStationFilterModel@@UBE?AVQModelIndex@@HHABV2@@Z @ 3 NONAME ; class QModelIndex RadioStationFilterModel::index(int, int, class QModelIndex const &) const
+	?parseFrequency@RadioStation@@SA?AVQString@@I@Z @ 4 NONAME ; class QString RadioStation::parseFrequency(unsigned int)
+	??0RadioStation@@QAE@ABV0@@Z @ 5 NONAME ; RadioStation::RadioStation(class RadioStation const &)
+	?frequency@RadioStation@@QBEIXZ @ 6 NONAME ; unsigned int RadioStation::frequency(void) const
+	?setFavoriteByFrequency@RadioStationModel@@QAEXI_N@Z @ 7 NONAME ; void RadioStationModel::setFavoriteByFrequency(unsigned int, bool)
+	??_ERadioHistoryItem@@UAE@I@Z @ 8 NONAME ; RadioHistoryItem::~RadioHistoryItem(unsigned int)
+	?staticMetaObject@RadioUiEngine@@2UQMetaObject@@B @ 9 NONAME ; struct QMetaObject const RadioUiEngine::staticMetaObject
+	?setName@RadioStation@@QAEXABVQString@@@Z @ 10 NONAME ; void RadioStation::setName(class QString const &)
+	?qt_metacast@RadioCarouselModel@@UAEPAXPBD@Z @ 11 NONAME ; void * RadioCarouselModel::qt_metacast(char const *)
+	?setFavoriteByPreset@RadioStationModel@@QAEXH_N@Z @ 12 NONAME ; void RadioStationModel::setFavoriteByPreset(int, bool)
+	?decrementReferenceCount@RadioHistoryItem@@AAEXXZ @ 13 NONAME ; void RadioHistoryItem::decrementReferenceCount(void)
+	?qt_metacall@RadioHistoryModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 14 NONAME ; int RadioHistoryModel::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?emitVolumeChanged@RadioUiEngine@@AAEXH@Z @ 15 NONAME ; void RadioUiEngine::emitVolumeChanged(int)
+	?qt_metacall@RadioUiEngine@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 16 NONAME ; int RadioUiEngine::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?addItem@RadioHistoryModel@@AAEXABVQString@@0ABVRadioStation@@@Z @ 17 NONAME ; void RadioHistoryModel::addItem(class QString const &, class QString const &, class RadioStation const &)
+	?trUtf8@RadioCarouselModel@@SA?AVQString@@PBD0H@Z @ 18 NONAME ; class QString RadioCarouselModel::trUtf8(char const *, char const *, int)
+	?setGenre@RadioStation@@QAEXH@Z @ 19 NONAME ; void RadioStation::setGenre(int)
+	??4RadioStation@@QAEAAV0@ABV0@@Z @ 20 NONAME ; class RadioStation & RadioStation::operator=(class RadioStation const &)
+	?stationModel@RadioUiEngine@@QAEAAVRadioStationModel@@XZ @ 21 NONAME ; class RadioStationModel & RadioUiEngine::stationModel(void)
+	?toggleTagging@RadioHistoryModel@@QAEXABVRadioHistoryItem@@H@Z @ 22 NONAME ; void RadioHistoryModel::toggleTagging(class RadioHistoryItem const &, int)
+	?muteChanged@RadioUiEngine@@IAEX_N@Z @ 23 NONAME ; void RadioUiEngine::muteChanged(bool)
+	?maxFrequency@RadioUiEngine@@QBEIXZ @ 24 NONAME ; unsigned int RadioUiEngine::maxFrequency(void) const
+	?saveStation@RadioStationModel@@QAEXAAVRadioStation@@@Z @ 25 NONAME ; void RadioStationModel::saveStation(class RadioStation &)
+	?hasChanged@RadioStation@@QBE_NXZ @ 26 NONAME ; bool RadioStation::hasChanged(void) const
+	??0RadioCarouselModel@@AAE@AAVRadioUiEngine@@AAVRadioStationModel@@@Z @ 27 NONAME ; RadioCarouselModel::RadioCarouselModel(class RadioUiEngine &, class RadioStationModel &)
+	?trUtf8@RadioScannerEngine@@SA?AVQString@@PBD0H@Z @ 28 NONAME ; class QString RadioScannerEngine::trUtf8(char const *, char const *, int)
+	?isScanning@RadioUiEngine@@QBE_NXZ @ 29 NONAME ; bool RadioUiEngine::isScanning(void) const
+	?d_func@RadioHistoryModel@@AAEPAVRadioHistoryModelPrivate@@XZ @ 30 NONAME ; class RadioHistoryModelPrivate * RadioHistoryModel::d_func(void)
+	?piCodeToCallSign@RadioStation@@AAE?AVQString@@I@Z @ 31 NONAME ; class QString RadioStation::piCodeToCallSign(unsigned int)
+	?hasLooped@RadioStationFilterModel@@QBE_NABVQModelIndex@@@Z @ 32 NONAME ; bool RadioStationFilterModel::hasLooped(class QModelIndex const &) const
+	?favoriteChanged@RadioStationModel@@IAEXABVRadioStation@@@Z @ 33 NONAME ; void RadioStationModel::favoriteChanged(class RadioStation const &)
+	?radioStatusChanged@RadioUiEngine@@IAEX_N@Z @ 34 NONAME ; void RadioUiEngine::radioStatusChanged(bool)
+	?setIcons@RadioHistoryModel@@QAEXABVQIcon@@0@Z @ 35 NONAME ; void RadioHistoryModel::setIcons(class QIcon const &, class QIcon const &)
+	?isCurrentSongRecognized@RadioHistoryModel@@QBE_NXZ @ 36 NONAME ; bool RadioHistoryModel::isCurrentSongRecognized(void) const
+	?clearRadioTextPlus@RadioHistoryModel@@AAEXXZ @ 37 NONAME ; void RadioHistoryModel::clearRadioTextPlus(void)
+	?addStation@RadioStationModel@@QAEXABVRadioStation@@@Z @ 38 NONAME ; void RadioStationModel::addStation(class RadioStation const &)
+	?favoriteCount@RadioStationModel@@QAEHXZ @ 39 NONAME ; int RadioStationModel::favoriteCount(void)
+	?createNewFilterModel@RadioUiEngine@@QAEPAVRadioStationFilterModel@@PAVQObject@@@Z @ 40 NONAME ; class RadioStationFilterModel * RadioUiEngine::createNewFilterModel(class QObject *)
+	??1RadioScannerEngine@@UAE@XZ @ 41 NONAME ; RadioScannerEngine::~RadioScannerEngine(void)
+	?isScanning@RadioScannerEngine@@QBE_NXZ @ 42 NONAME ; bool RadioScannerEngine::isScanning(void) const
+	?tunePreset@RadioUiEngine@@QAEXH@Z @ 43 NONAME ; void RadioUiEngine::tunePreset(int)
+	?trUtf8@RadioScannerEngine@@SA?AVQString@@PBD0@Z @ 44 NONAME ; class QString RadioScannerEngine::trUtf8(char const *, char const *)
+	?emitDataChanged@RadioStationModel@@AAEXABVRadioStation@@@Z @ 45 NONAME ; void RadioStationModel::emitDataChanged(class RadioStation const &)
+	?isRadioOn@RadioUiEngine@@QBE_NXZ @ 46 NONAME ; bool RadioUiEngine::isRadioOn(void) const
+	?continueScanning@RadioScannerEngine@@QAEXXZ @ 47 NONAME ; void RadioScannerEngine::continueScanning(void)
+	?modelIndexFromFrequency@RadioStationModel@@QAE?AVQModelIndex@@I@Z @ 48 NONAME ; class QModelIndex RadioStationModel::modelIndexFromFrequency(unsigned int)
+	?list@RadioStationModel@@QBEABV?$QMap@IVRadioStation@@@@XZ @ 49 NONAME ; class QMap<unsigned int, class RadioStation> const & RadioStationModel::list(void) const
+	?tr@RadioStationModel@@SA?AVQString@@PBD0@Z @ 50 NONAME ; class QString RadioStationModel::tr(char const *, char const *)
+	?tr@RadioCarouselModel@@SA?AVQString@@PBD0H@Z @ 51 NONAME ; class QString RadioCarouselModel::tr(char const *, char const *, int)
+	?setChangeFlags@RadioStation@@QAEXV?$QFlags@W4ChangeFlag@RadioStation@@@@@Z @ 52 NONAME ; void RadioStation::setChangeFlags(class QFlags<enum RadioStation::ChangeFlag>)
+	?hasRds@RadioStation@@QBE_NXZ @ 53 NONAME ; bool RadioStation::hasRds(void) const
+	?findClosest@RadioStationModel@@QAE?AVRadioStation@@IW4Mode@StationSkip@@@Z @ 54 NONAME ; class RadioStation RadioStationModel::findClosest(unsigned int, enum StationSkip::Mode)
+	?flags@RadioStationModel@@UBE?AV?$QFlags@W4ItemFlag@Qt@@@@ABVQModelIndex@@@Z @ 55 NONAME ; class QFlags<enum Qt::ItemFlag> RadioStationModel::flags(class QModelIndex const &) const
+	?id@RadioHistoryItem@@QBEHXZ @ 56 NONAME ; int RadioHistoryItem::id(void) const
+	?stationsInRange@RadioUiEngine@@QAE?AV?$QList@VRadioStation@@@@II@Z @ 57 NONAME ; class QList<class RadioStation> RadioUiEngine::stationsInRange(unsigned int, unsigned int)
+	?trUtf8@RadioUiEngine@@SA?AVQString@@PBD0@Z @ 58 NONAME ; class QString RadioUiEngine::trUtf8(char const *, char const *)
+	?tr@RadioScannerEngine@@SA?AVQString@@PBD0H@Z @ 59 NONAME ; class QString RadioScannerEngine::tr(char const *, char const *, int)
+	??_ERadioCarouselModel@@UAE@I@Z @ 60 NONAME ; RadioCarouselModel::~RadioCarouselModel(unsigned int)
+	??0RadioStation@@QAE@HI@Z @ 61 NONAME ; RadioStation::RadioStation(int, unsigned int)
+	?setVolume@RadioUiEngine@@QAEXH@Z @ 62 NONAME ; void RadioUiEngine::setVolume(int)
+	?setFavorite@RadioStation@@QAEX_N@Z @ 63 NONAME ; void RadioStation::setFavorite(bool)
+	?d_func@RadioStationModel@@ABEPBVRadioStationModelPrivate@@XZ @ 64 NONAME ; class RadioStationModelPrivate const * RadioStationModel::d_func(void) const
+	?setCyclic@RadioStationFilterModel@@QAEX_N@Z @ 65 NONAME ; void RadioStationFilterModel::setCyclic(bool)
+	??1RadioStationModel@@UAE@XZ @ 66 NONAME ; RadioStationModel::~RadioStationModel(void)
+	?isMuted@RadioUiEngine@@QBE_NXZ @ 67 NONAME ; bool RadioUiEngine::isMuted(void) const
+	?isValid@RadioStation@@QBE_NXZ @ 68 NONAME ; bool RadioStation::isValid(void) const
+	?isEqual@RadioStationFilterModel@@QBE_NABVQModelIndex@@0@Z @ 69 NONAME ; bool RadioStationFilterModel::isEqual(class QModelIndex const &, class QModelIndex const &) const
+	?decrementReferenceCount@RadioStation@@AAEXXZ @ 70 NONAME ; void RadioStation::decrementReferenceCount(void)
+	?trUtf8@RadioUiEngine@@SA?AVQString@@PBD0H@Z @ 71 NONAME ; class QString RadioUiEngine::trUtf8(char const *, char const *, int)
+	?reset@RadioHistoryItem@@QAEXXZ @ 72 NONAME ; void RadioHistoryItem::reset(void)
+	?trUtf8@RadioStationModel@@SA?AVQString@@PBD0@Z @ 73 NONAME ; class QString RadioStationModel::trUtf8(char const *, char const *)
+	??0RadioStationModel@@QAE@AAVRadioUiEnginePrivate@@@Z @ 74 NONAME ; RadioStationModel::RadioStationModel(class RadioUiEnginePrivate &)
+	?tuneFrequency@RadioUiEngine@@QAEXIH@Z @ 75 NONAME ; void RadioUiEngine::tuneFrequency(unsigned int, int)
+	?frequency@RadioHistoryItem@@QBEIXZ @ 76 NONAME ; unsigned int RadioHistoryItem::frequency(void) const
+	?qt_metacall@RadioScannerEngine@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 77 NONAME ; int RadioScannerEngine::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?emitTunedToFrequency@RadioUiEngine@@AAEXIH@Z @ 78 NONAME ; void RadioUiEngine::emitTunedToFrequency(unsigned int, int)
+	?psType@RadioStation@@QBE?AV?$QFlags@W4PsTypeFlag@RadioStation@@@@XZ @ 79 NONAME ; class QFlags<enum RadioStation::PsTypeFlag> RadioStation::psType(void) const
+	?d_func@RadioUiEngine@@ABEPBVRadioUiEnginePrivate@@XZ @ 80 NONAME ; class RadioUiEnginePrivate const * RadioUiEngine::d_func(void) const
+	?rowCount@RadioCarouselModel@@UBEHABVQModelIndex@@@Z @ 81 NONAME ; int RadioCarouselModel::rowCount(class QModelIndex const &) const
+	?scannerEngine@RadioUiEngine@@QAEPAVRadioScannerEngine@@XZ @ 82 NONAME ; class RadioScannerEngine * RadioUiEngine::scannerEngine(void)
+	?startScanning@RadioScannerEngine@@QAEXXZ @ 83 NONAME ; void RadioScannerEngine::startScanning(void)
+	?emitStationFound@RadioScannerEngine@@AAEXABVRadioStation@@@Z @ 84 NONAME ; void RadioScannerEngine::emitStationFound(class RadioStation const &)
+	?findCurrentStation@RadioStationModel@@AAE?AVRadioStation@@I@Z @ 85 NONAME ; class RadioStation RadioStationModel::findCurrentStation(unsigned int)
+	??4RadioHistoryItem@@QAEAAV0@ABV0@@Z @ 86 NONAME ; class RadioHistoryItem & RadioHistoryItem::operator=(class RadioHistoryItem const &)
+	?url@RadioStation@@QBE?AVQString@@XZ @ 87 NONAME ; class QString RadioStation::url(void) const
+	?historyModel@RadioUiEngine@@QAEAAVRadioHistoryModel@@XZ @ 88 NONAME ; class RadioHistoryModel & RadioUiEngine::historyModel(void)
+	?frequencyMhz@RadioStation@@QBE?AVQString@@XZ @ 89 NONAME ; class QString RadioStation::frequencyMhz(void) const
+	?setStation@RadioHistoryItem@@QAEXABVQString@@@Z @ 90 NONAME ; void RadioHistoryItem::setStation(class QString const &)
+	?qt_metacast@RadioStationModel@@UAEPAXPBD@Z @ 91 NONAME ; void * RadioStationModel::qt_metacast(char const *)
+	?getStaticMetaObject@RadioCarouselModel@@SAABUQMetaObject@@XZ @ 92 NONAME ; struct QMetaObject const & RadioCarouselModel::getStaticMetaObject(void)
+	?filterAcceptsRow@RadioStationFilterModel@@EBE_NHABVQModelIndex@@@Z @ 93 NONAME ; bool RadioStationFilterModel::filterAcceptsRow(int, class QModelIndex const &) const
+	?cancel@RadioScannerEngine@@QAEXXZ @ 94 NONAME ; void RadioScannerEngine::cancel(void)
+	?addRecognizedSong@RadioUiEngine@@QAEXABVQString@@0ABVRadioStation@@@Z @ 95 NONAME ; void RadioUiEngine::addRecognizedSong(class QString const &, class QString const &, class RadioStation const &)
+	?emitMuteChanged@RadioUiEngine@@AAEX_N@Z @ 96 NONAME ; void RadioUiEngine::emitMuteChanged(bool)
+	?removeByPresetIndex@RadioStationModel@@QAEXH@Z @ 97 NONAME ; void RadioStationModel::removeByPresetIndex(int)
+	?d_func@RadioScannerEngine@@AAEPAVRadioScannerEnginePrivate@@XZ @ 98 NONAME ; class RadioScannerEnginePrivate * RadioScannerEngine::d_func(void)
+	?stationAt@RadioStationModel@@QBE?AVRadioStation@@H@Z @ 99 NONAME ; class RadioStation RadioStationModel::stationAt(int) const
+	?dynamicPsChanged@RadioStationModel@@IAEXABVRadioStation@@@Z @ 100 NONAME ; void RadioStationModel::dynamicPsChanged(class RadioStation const &)
+	?setType@RadioStation@@QAEXV?$QFlags@W4TypeFlag@RadioStation@@@@@Z @ 101 NONAME ; void RadioStation::setType(class QFlags<enum RadioStation::TypeFlag>)
+	??0RadioHistoryItem@@QAE@XZ @ 102 NONAME ; RadioHistoryItem::RadioHistoryItem(void)
+	?findPresetIndex@RadioStationModel@@QAEHH@Z @ 103 NONAME ; int RadioStationModel::findPresetIndex(int)
+	?setRadioTextPlus@RadioStation@@QAEXHABVQString@@@Z @ 104 NONAME ; void RadioStation::setRadioTextPlus(int, class QString const &)
+	?metaObject@RadioStationModel@@UBEPBUQMetaObject@@XZ @ 105 NONAME ; struct QMetaObject const * RadioStationModel::metaObject(void) const
+	?getStaticMetaObject@RadioStationModel@@SAABUQMetaObject@@XZ @ 106 NONAME ; struct QMetaObject const & RadioStationModel::getStaticMetaObject(void)
+	?tr@RadioScannerEngine@@SA?AVQString@@PBD0@Z @ 107 NONAME ; class QString RadioScannerEngine::tr(char const *, char const *)
+	?dynamicPsText@RadioStation@@QBE?AVQString@@XZ @ 108 NONAME ; class QString RadioStation::dynamicPsText(void) const
+	?isFirstTimeStart@RadioUiEngine@@QAE_NXZ @ 109 NONAME ; bool RadioUiEngine::isFirstTimeStart(void)
+	?setMute@RadioUiEngine@@QAEX_N@Z @ 110 NONAME ; void RadioUiEngine::setMute(bool)
+	?init@RadioUiEngine@@QAE_NXZ @ 111 NONAME ; bool RadioUiEngine::init(void)
+	?changeFlags@RadioStation@@QBE?AV?$QFlags@W4ChangeFlag@RadioStation@@@@XZ @ 112 NONAME ; class QFlags<enum RadioStation::ChangeFlag> RadioStation::changeFlags(void) const
+	?qt_metacast@RadioHistoryModel@@UAEPAXPBD@Z @ 113 NONAME ; void * RadioHistoryModel::qt_metacast(char const *)
+	??1RadioUiEngine@@UAE@XZ @ 114 NONAME ; RadioUiEngine::~RadioUiEngine(void)
+	?tr@RadioHistoryModel@@SA?AVQString@@PBD0@Z @ 115 NONAME ; class QString RadioHistoryModel::tr(char const *, char const *)
+	?metaObject@RadioCarouselModel@@UBEPBUQMetaObject@@XZ @ 116 NONAME ; struct QMetaObject const * RadioCarouselModel::metaObject(void) const
+	?d_func@RadioCarouselModel@@AAEPAVRadioCarouselModelPrivate@@XZ @ 117 NONAME ; class RadioCarouselModelPrivate * RadioCarouselModel::d_func(void)
+	?initialize@RadioStationModel@@QAEXPAVRadioPresetStorage@@PAVRadioEngineWrapper@@@Z @ 118 NONAME ; void RadioStationModel::initialize(class RadioPresetStorage *, class RadioEngineWrapper *)
+	?resetCurrentSong@RadioHistoryModel@@QAEXXZ @ 119 NONAME ; void RadioHistoryModel::resetCurrentSong(void)
+	?d_func@RadioHistoryModel@@ABEPBVRadioHistoryModelPrivate@@XZ @ 120 NONAME ; class RadioHistoryModelPrivate const * RadioHistoryModel::d_func(void) const
+	?stationFound@RadioScannerEngine@@IAEXABVRadioStation@@@Z @ 121 NONAME ; void RadioScannerEngine::stationFound(class RadioStation const &)
+	?resetChangeFlags@RadioStation@@QAEXXZ @ 122 NONAME ; void RadioStation::resetChangeFlags(void)
+	??_ERadioStationFilterModel@@UAE@I@Z @ 123 NONAME ; RadioStationFilterModel::~RadioStationFilterModel(unsigned int)
+	?metaObject@RadioScannerEngine@@UBEPBUQMetaObject@@XZ @ 124 NONAME ; struct QMetaObject const * RadioScannerEngine::metaObject(void) const
+	?callSignChar@RadioStation@@AAEDI@Z @ 125 NONAME ; char RadioStation::callSignChar(unsigned int)
+	??_ERadioStation@@UAE@I@Z @ 126 NONAME ; RadioStation::~RadioStation(unsigned int)
+	?detach@RadioHistoryItem@@QAEXXZ @ 127 NONAME ; void RadioHistoryItem::detach(void)
+	?staticMetaObject@RadioHistoryModel@@2UQMetaObject@@B @ 128 NONAME ; struct QMetaObject const RadioHistoryModel::staticMetaObject
+	?isDetached@RadioStation@@QBE_NXZ @ 129 NONAME ; bool RadioStation::isDetached(void) const
+	??0RadioHistoryItem@@QAE@ABVQString@@0@Z @ 130 NONAME ; RadioHistoryItem::RadioHistoryItem(class QString const &, class QString const &)
+	?removeAll@RadioStationModel@@QAEXW4RemoveMode@1@@Z @ 131 NONAME ; void RadioStationModel::removeAll(enum RadioStationModel::RemoveMode)
+	?data_ptr@RadioHistoryItem@@QAEAAPAVRadioHistoryItemPrivate@@XZ @ 132 NONAME ; class RadioHistoryItemPrivate * & RadioHistoryItem::data_ptr(void)
+	?setShowDetails@RadioHistoryModel@@QAEX_N@Z @ 133 NONAME ; void RadioHistoryModel::setShowDetails(bool)
+	?rowCount@RadioStationModel@@UBEHABVQModelIndex@@@Z @ 134 NONAME ; int RadioStationModel::rowCount(class QModelIndex const &) const
+	?toggleMute@RadioUiEngine@@QAEXXZ @ 135 NONAME ; void RadioUiEngine::toggleMute(void)
+	?genreToString@RadioUiEngine@@QAE?AVQString@@HW4Target@GenreTarget@@@Z @ 136 NONAME ; class QString RadioUiEngine::genreToString(int, enum GenreTarget::Target)
+	?d_func@RadioUiEngine@@AAEPAVRadioUiEnginePrivate@@XZ @ 137 NONAME ; class RadioUiEnginePrivate * RadioUiEngine::d_func(void)
+	?station@RadioHistoryItem@@QBE?AVQString@@XZ @ 138 NONAME ; class QString RadioHistoryItem::station(void) const
+	??_ERadioHistoryModel@@UAE@I@Z @ 139 NONAME ; RadioHistoryModel::~RadioHistoryModel(unsigned int)
+	??1RadioCarouselModel@@UAE@XZ @ 140 NONAME ; RadioCarouselModel::~RadioCarouselModel(void)
+	?addScannedFrequency@RadioScannerEngine@@QAEXI@Z @ 141 NONAME ; void RadioScannerEngine::addScannedFrequency(unsigned int)
+	?trUtf8@RadioHistoryModel@@SA?AVQString@@PBD0@Z @ 142 NONAME ; class QString RadioHistoryModel::trUtf8(char const *, char const *)
+	?frequencyStepSize@RadioUiEngine@@QBEIXZ @ 143 NONAME ; unsigned int RadioUiEngine::frequencyStepSize(void) const
+	??0RadioHistoryModel@@AAE@AAVRadioUiEngine@@@Z @ 144 NONAME ; RadioHistoryModel::RadioHistoryModel(class RadioUiEngine &)
+	?trUtf8@RadioStationModel@@SA?AVQString@@PBD0H@Z @ 145 NONAME ; class QString RadioStationModel::trUtf8(char const *, char const *, int)
+	?metaObject@RadioHistoryModel@@UBEPBUQMetaObject@@XZ @ 146 NONAME ; struct QMetaObject const * RadioHistoryModel::metaObject(void) const
+	?setFavorites@RadioStationModel@@QAEXABV?$QList@VQModelIndex@@@@@Z @ 147 NONAME ; void RadioStationModel::setFavorites(class QList<class QModelIndex> const &)
+	?setArtist@RadioHistoryItem@@QAEXABVQString@@@Z @ 148 NONAME ; void RadioHistoryItem::setArtist(class QString const &)
+	?setTitle@RadioHistoryItem@@QAEXABVQString@@@Z @ 149 NONAME ; void RadioHistoryItem::setTitle(class QString const &)
+	?isOfflineProfile@RadioUiEngine@@SA_NXZ @ 150 NONAME ; bool RadioUiEngine::isOfflineProfile(void)
+	?tr@RadioUiEngine@@SA?AVQString@@PBD0@Z @ 151 NONAME ; class QString RadioUiEngine::tr(char const *, char const *)
+	?currentStation@RadioStationModel@@QBEABVRadioStation@@XZ @ 152 NONAME ; class RadioStation const & RadioStationModel::currentStation(void) const
+	?rowCount@RadioHistoryModel@@UBEHABVQModelIndex@@@Z @ 153 NONAME ; int RadioHistoryModel::rowCount(class QModelIndex const &) const
+	?region@RadioUiEngine@@QBE?AW4Region@RadioRegion@@XZ @ 154 NONAME ; enum RadioRegion::Region RadioUiEngine::region(void) const
+	?skipStation@RadioUiEngine@@QAEIW4Mode@StationSkip@@I@Z @ 155 NONAME ; unsigned int RadioUiEngine::skipStation(enum StationSkip::Mode, unsigned int)
+	?isInitialized@RadioUiEngine@@QBE_NXZ @ 156 NONAME ; bool RadioUiEngine::isInitialized(void) const
+	?findFrequency@RadioStationModel@@QAE_NIAAVRadioStation@@@Z @ 157 NONAME ; bool RadioStationModel::findFrequency(unsigned int, class RadioStation &)
+	?stationsInRange@RadioStationModel@@QAE?AV?$QList@VRadioStation@@@@II@Z @ 158 NONAME ; class QList<class RadioStation> RadioStationModel::stationsInRange(unsigned int, unsigned int)
+	?tuneWithDelay@RadioUiEngine@@QAEXIH@Z @ 159 NONAME ; void RadioUiEngine::tuneWithDelay(unsigned int, int)
+	?emitAntennaStatusChanged@RadioUiEngine@@AAEX_N@Z @ 160 NONAME ; void RadioUiEngine::emitAntennaStatusChanged(bool)
+	?settings@RadioUiEngine@@QAEAAVRadioSettingsIf@@XZ @ 161 NONAME ; class RadioSettingsIf & RadioUiEngine::settings(void)
+	??_ERadioScannerEngine@@UAE@I@Z @ 162 NONAME ; RadioScannerEngine::~RadioScannerEngine(unsigned int)
+	?hasPiCode@RadioStation@@QBE_NXZ @ 163 NONAME ; bool RadioStation::hasPiCode(void) const
+	?rdsAvailabilityChanged@RadioUiEngine@@IAEX_N@Z @ 164 NONAME ; void RadioUiEngine::rdsAvailabilityChanged(bool)
+	?qt_metacall@RadioCarouselModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 165 NONAME ; int RadioCarouselModel::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?findPresetIndex@RadioStationModel@@QAEHHAAVRadioStation@@@Z @ 166 NONAME ; int RadioStationModel::findPresetIndex(int, class RadioStation &)
+	?stationHandlerIf@RadioStationModel@@QAEAAVRadioStationHandlerIf@@XZ @ 167 NONAME ; class RadioStationHandlerIf & RadioStationModel::stationHandlerIf(void)
+	?emitSeekingStarted@RadioUiEngine@@AAEXW4Direction@Seeking@@@Z @ 168 NONAME ; void RadioUiEngine::emitSeekingStarted(enum Seeking::Direction)
+	??1RadioStationFilterModel@@UAE@XZ @ 169 NONAME ; RadioStationFilterModel::~RadioStationFilterModel(void)
+	?emitAudioRouteChanged@RadioUiEngine@@AAEX_N@Z @ 170 NONAME ; void RadioUiEngine::emitAudioRouteChanged(bool)
+	?d_func@RadioScannerEngine@@ABEPBVRadioScannerEnginePrivate@@XZ @ 171 NONAME ; class RadioScannerEnginePrivate const * RadioScannerEngine::d_func(void) const
+	?toggleAudioRoute@RadioUiEngine@@QAEXXZ @ 172 NONAME ; void RadioUiEngine::toggleAudioRoute(void)
+	?unsetType@RadioStation@@QAEXV?$QFlags@W4TypeFlag@RadioStation@@@@@Z @ 173 NONAME ; void RadioStation::unsetType(class QFlags<enum RadioStation::TypeFlag>)
+	?setIcons@RadioStationModel@@QAEXABVQIcon@@0@Z @ 174 NONAME ; void RadioStationModel::setIcons(class QIcon const &, class QIcon const &)
+	?findUnusedPresetIndex@RadioStationModel@@AAEHXZ @ 175 NONAME ; int RadioStationModel::findUnusedPresetIndex(void)
+	?getStaticMetaObject@RadioHistoryModel@@SAABUQMetaObject@@XZ @ 176 NONAME ; struct QMetaObject const & RadioHistoryModel::getStaticMetaObject(void)
+	?dynamicPsCheckEnded@RadioStationModel@@AAEXXZ @ 177 NONAME ; void RadioStationModel::dynamicPsCheckEnded(void)
+	?seekStation@RadioUiEngine@@QAEXH@Z @ 178 NONAME ; void RadioUiEngine::seekStation(int)
+	?setPiCode@RadioStation@@QAE_NHW4Region@RadioRegion@@@Z @ 179 NONAME ; bool RadioStation::setPiCode(int, enum RadioRegion::Region)
+	?lastTunedFrequency@RadioUiEngine@@SAIXZ @ 180 NONAME ; unsigned int RadioUiEngine::lastTunedFrequency(void)
+	?tunedToFrequency@RadioUiEngine@@IAEXIH@Z @ 181 NONAME ; void RadioUiEngine::tunedToFrequency(unsigned int, int)
+	?tr@RadioUiEngine@@SA?AVQString@@PBD0H@Z @ 182 NONAME ; class QString RadioUiEngine::tr(char const *, char const *, int)
+	?trUtf8@RadioHistoryModel@@SA?AVQString@@PBD0H@Z @ 183 NONAME ; class QString RadioHistoryModel::trUtf8(char const *, char const *, int)
+	?data@RadioStationFilterModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 184 NONAME ; class QVariant RadioStationFilterModel::data(class QModelIndex const &, int) const
+	?detach@RadioStation@@QAEXXZ @ 185 NONAME ; void RadioStation::detach(void)
+	?d_func@RadioCarouselModel@@ABEPBVRadioCarouselModelPrivate@@XZ @ 186 NONAME ; class RadioCarouselModelPrivate const * RadioCarouselModel::d_func(void) const
+	?staticMetaObject@RadioScannerEngine@@2UQMetaObject@@B @ 187 NONAME ; struct QMetaObject const RadioScannerEngine::staticMetaObject
+	?radioText@RadioStation@@QBE?AVQString@@XZ @ 188 NONAME ; class QString RadioStation::radioText(void) const
+	?setData@RadioStationModel@@UAE_NABVQModelIndex@@ABVQVariant@@H@Z @ 189 NONAME ; bool RadioStationModel::setData(class QModelIndex const &, class QVariant const &, int)
+	?setPsType@RadioStation@@QAEXV?$QFlags@W4PsTypeFlag@RadioStation@@@@@Z @ 190 NONAME ; void RadioStation::setPsType(class QFlags<enum RadioStation::PsTypeFlag>)
+	?itemAtIndex@RadioHistoryModel@@QBE?AVRadioHistoryItem@@ABVQModelIndex@@@Z @ 191 NONAME ; class RadioHistoryItem RadioHistoryModel::itemAtIndex(class QModelIndex const &) const
+	?emitChangeSignals@RadioStationModel@@AAEXABVRadioStation@@V?$QFlags@W4ChangeFlag@RadioStation@@@@@Z @ 192 NONAME ; void RadioStationModel::emitChangeSignals(class RadioStation const &, class QFlags<enum RadioStation::ChangeFlag>)
+	?setPresetIndex@RadioStation@@QAEXH@Z @ 193 NONAME ; void RadioStation::setPresetIndex(int)
+	?tr@RadioStationModel@@SA?AVQString@@PBD0H@Z @ 194 NONAME ; class QString RadioStationModel::tr(char const *, char const *, int)
+	?trUtf8@RadioCarouselModel@@SA?AVQString@@PBD0@Z @ 195 NONAME ; class QString RadioCarouselModel::trUtf8(char const *, char const *)
+	?renameStation@RadioStationModel@@QAEXHABVQString@@@Z @ 196 NONAME ; void RadioStationModel::renameStation(int, class QString const &)
+	?currentFrequency@RadioUiEngine@@QBEIXZ @ 197 NONAME ; unsigned int RadioUiEngine::currentFrequency(void) const
+	?emitItemAdded@RadioHistoryModel@@AAEXXZ @ 198 NONAME ; void RadioHistoryModel::emitItemAdded(void)
+	?setUserDefinedName@RadioStation@@QAEXABVQString@@@Z @ 199 NONAME ; void RadioStation::setUserDefinedName(class QString const &)
+	??1RadioStation@@UAE@XZ @ 200 NONAME ; RadioStation::~RadioStation(void)
+	?callSignString@RadioStation@@AAE?AVQString@@I@Z @ 201 NONAME ; class QString RadioStation::callSignString(unsigned int)
+	?getStaticMetaObject@RadioScannerEngine@@SAABUQMetaObject@@XZ @ 202 NONAME ; struct QMetaObject const & RadioScannerEngine::getStaticMetaObject(void)
+	?removeFrequency@RadioCarouselModel@@AAEXABVQModelIndex@@HH@Z @ 203 NONAME ; void RadioCarouselModel::removeFrequency(class QModelIndex const &, int, int)
+	?modelIndexFromFrequency@RadioStationFilterModel@@QAE?AVQModelIndex@@I@Z @ 204 NONAME ; class QModelIndex RadioStationFilterModel::modelIndexFromFrequency(unsigned int)
+	?stationDataChanged@RadioStationModel@@IAEXABVRadioStation@@@Z @ 205 NONAME ; void RadioStationModel::stationDataChanged(class RadioStation const &)
+	?currentStation@RadioStationModel@@QAEAAVRadioStation@@XZ @ 206 NONAME ; class RadioStation & RadioStationModel::currentStation(void)
+	?genre@RadioStation@@QBEHXZ @ 207 NONAME ; int RadioStation::genre(void) const
+	?isDetached@RadioHistoryItem@@QBE_NXZ @ 208 NONAME ; bool RadioHistoryItem::isDetached(void) const
+	?reset@RadioStation@@QAEXXZ @ 209 NONAME ; void RadioStation::reset(void)
+	??0RadioStation@@QAE@XZ @ 210 NONAME ; RadioStation::RadioStation(void)
+	??1RadioHistoryModel@@UAE@XZ @ 211 NONAME ; RadioHistoryModel::~RadioHistoryModel(void)
+	?data@RadioCarouselModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 212 NONAME ; class QVariant RadioCarouselModel::data(class QModelIndex const &, int) const
+	?isSongRecognitionAppAvailable@RadioUiEngine@@QAE_NXZ @ 213 NONAME ; bool RadioUiEngine::isSongRecognitionAppAvailable(void)
+	?isValid@RadioHistoryItem@@QBE_NXZ @ 214 NONAME ; bool RadioHistoryItem::isValid(void) const
+	?setUrl@RadioStation@@QAEXABVQString@@@Z @ 215 NONAME ; void RadioStation::setUrl(class QString const &)
+	?realIndex@RadioStationFilterModel@@QBE?AVQModelIndex@@ABV2@@Z @ 216 NONAME ; class QModelIndex RadioStationFilterModel::realIndex(class QModelIndex const &) const
+	?data@RadioHistoryModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 217 NONAME ; class QVariant RadioHistoryModel::data(class QModelIndex const &, int) const
+	?modelIndexFromFrequency@RadioCarouselModel@@QAE?AVQModelIndex@@I@Z @ 218 NONAME ; class QModelIndex RadioCarouselModel::modelIndexFromFrequency(unsigned int)
+	?isAntennaAttached@RadioUiEngine@@QBE_NXZ @ 219 NONAME ; bool RadioUiEngine::isAntennaAttached(void) const
+	?emitRdsAvailabilityChanged@RadioUiEngine@@AAEX_N@Z @ 220 NONAME ; void RadioUiEngine::emitRdsAvailabilityChanged(bool)
+	??0RadioStationFilterModel@@QAE@AAVRadioUiEngine@@PAVQObject@@@Z @ 221 NONAME ; RadioStationFilterModel::RadioStationFilterModel(class RadioUiEngine &, class QObject *)
+	?presetIndex@RadioStation@@QBEHXZ @ 222 NONAME ; int RadioStation::presetIndex(void) const
+	?staticMetaObject@RadioStationModel@@2UQMetaObject@@B @ 223 NONAME ; struct QMetaObject const RadioStationModel::staticMetaObject
+	?currentSongReset@RadioHistoryModel@@IAEXXZ @ 224 NONAME ; void RadioHistoryModel::currentSongReset(void)
+	?setFrequency@RadioStation@@QAEXI@Z @ 225 NONAME ; void RadioStation::setFrequency(unsigned int)
+	?isRenamed@RadioStation@@QBE_NXZ @ 226 NONAME ; bool RadioStation::isRenamed(void) const
+	?metaObject@RadioUiEngine@@UBEPBUQMetaObject@@XZ @ 227 NONAME ; struct QMetaObject const * RadioUiEngine::metaObject(void) const
+	?removeStation@RadioStationModel@@QAEXABVRadioStation@@@Z @ 228 NONAME ; void RadioStationModel::removeStation(class RadioStation const &)
+	?isUsingLoudspeaker@RadioUiEngine@@QBE_NXZ @ 229 NONAME ; bool RadioUiEngine::isUsingLoudspeaker(void) const
+	?removeByFrequency@RadioStationModel@@QAEXI@Z @ 230 NONAME ; void RadioStationModel::removeByFrequency(unsigned int)
+	??0RadioHistoryItem@@QAE@ABV0@@Z @ 231 NONAME ; RadioHistoryItem::RadioHistoryItem(class RadioHistoryItem const &)
+	?audioRouteChanged@RadioUiEngine@@IAEX_N@Z @ 232 NONAME ; void RadioUiEngine::audioRouteChanged(bool)
+	?findClosest@RadioCarouselModel@@QAE?AVRadioStation@@IW4Mode@StationSkip@@@Z @ 233 NONAME ; class RadioStation RadioCarouselModel::findClosest(unsigned int, enum StationSkip::Mode)
+	?tr@RadioHistoryModel@@SA?AVQString@@PBD0H@Z @ 234 NONAME ; class QString RadioHistoryModel::tr(char const *, char const *, int)
+	?emitRadioStatusChanged@RadioUiEngine@@AAEX_N@Z @ 235 NONAME ; void RadioUiEngine::emitRadioStatusChanged(bool)
+	??0RadioScannerEngine@@QAE@AAVRadioUiEnginePrivate@@@Z @ 236 NONAME ; RadioScannerEngine::RadioScannerEngine(class RadioUiEnginePrivate &)
+	??_ERadioUiEngine@@UAE@I@Z @ 237 NONAME ; RadioUiEngine::~RadioUiEngine(unsigned int)
+	?setDynamicPsText@RadioStation@@QAEXABVQString@@@Z @ 238 NONAME ; void RadioStation::setDynamicPsText(class QString const &)
+	?addRadioTextPlus@RadioHistoryModel@@AAEXHABVQString@@ABVRadioStation@@@Z @ 239 NONAME ; void RadioHistoryModel::addRadioTextPlus(int, class QString const &, class RadioStation const &)
+	?d_func@RadioStationModel@@AAEPAVRadioStationModelPrivate@@XZ @ 240 NONAME ; class RadioStationModelPrivate * RadioStationModel::d_func(void)
+	?setDetail@RadioStationModel@@QAEXV?$QFlags@W4DetailFlag@RadioStationModel@@@@@Z @ 241 NONAME ; void RadioStationModel::setDetail(class QFlags<enum RadioStationModel::DetailFlag>)
+	?removeAll@RadioHistoryModel@@QAEXXZ @ 242 NONAME ; void RadioHistoryModel::removeAll(void)
+	?rowCount@RadioStationFilterModel@@UBEHABVQModelIndex@@@Z @ 243 NONAME ; int RadioStationFilterModel::rowCount(class QModelIndex const &) const
+	?artist@RadioHistoryItem@@QBE?AVQString@@XZ @ 244 NONAME ; class QString RadioHistoryItem::artist(void) const
+	?reportChangedData@RadioHistoryModel@@AAEXHH@Z @ 245 NONAME ; void RadioHistoryModel::reportChangedData(int, int)
+	?time@RadioHistoryItem@@QBE?AVQString@@XZ @ 246 NONAME ; class QString RadioHistoryItem::time(void) const
+	?isType@RadioStation@@QBE_NV?$QFlags@W4TypeFlag@RadioStation@@@@@Z @ 247 NONAME ; bool RadioStation::isType(class QFlags<enum RadioStation::TypeFlag>) const
+	?carouselModel@RadioUiEngine@@QAEPAVRadioCarouselModel@@XZ @ 248 NONAME ; class RadioCarouselModel * RadioUiEngine::carouselModel(void)
+	?setTypeFilter@RadioStationFilterModel@@QAEXV?$QFlags@W4TypeFlag@RadioStation@@@@@Z @ 249 NONAME ; void RadioStationFilterModel::setTypeFilter(class QFlags<enum RadioStation::TypeFlag>)
+	?volumeChanged@RadioUiEngine@@IAEXH@Z @ 250 NONAME ; void RadioUiEngine::volumeChanged(int)
+	?title@RadioHistoryItem@@QBE?AVQString@@XZ @ 251 NONAME ; class QString RadioHistoryItem::title(void) const
+	?data_ptr@RadioStation@@QAEAAPAVRadioStationPrivate@@XZ @ 252 NONAME ; class RadioStationPrivate * & RadioStation::data_ptr(void)
+	?qt_metacast@RadioScannerEngine@@UAEPAXPBD@Z @ 253 NONAME ; void * RadioScannerEngine::qt_metacast(char const *)
+	?tr@RadioCarouselModel@@SA?AVQString@@PBD0@Z @ 254 NONAME ; class QString RadioCarouselModel::tr(char const *, char const *)
+	??1RadioHistoryItem@@UAE@XZ @ 255 NONAME ; RadioHistoryItem::~RadioHistoryItem(void)
+	?antennaStatusChanged@RadioUiEngine@@IAEX_N@Z @ 256 NONAME ; void RadioUiEngine::antennaStatusChanged(bool)
+	?qt_metacall@RadioStationModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 257 NONAME ; int RadioStationModel::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?setRadioText@RadioStation@@QAEXABVQString@@@Z @ 258 NONAME ; void RadioStation::setRadioText(class QString const &)
+	?hasDataChanged@RadioStation@@QBE_NV?$QFlags@W4ChangeFlag@RadioStation@@@@@Z @ 259 NONAME ; bool RadioStation::hasDataChanged(class QFlags<enum RadioStation::ChangeFlag>) const
+	?name@RadioStation@@QBE?AVQString@@XZ @ 260 NONAME ; class QString RadioStation::name(void) const
+	?data@RadioStationModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 261 NONAME ; class QVariant RadioStationModel::data(class QModelIndex const &, int) const
+	?itemAdded@RadioHistoryModel@@IAEXXZ @ 262 NONAME ; void RadioHistoryModel::itemAdded(void)
+	?getStaticMetaObject@RadioUiEngine@@SAABUQMetaObject@@XZ @ 263 NONAME ; struct QMetaObject const & RadioUiEngine::getStaticMetaObject(void)
+	?launchSongRecognition@RadioUiEngine@@QAEXXZ @ 264 NONAME ; void RadioUiEngine::launchSongRecognition(void)
+	?iterateCallSign@RadioStation@@AAE?AVQString@@HH@Z @ 265 NONAME ; class QString RadioStation::iterateCallSign(int, int)
+	??0RadioUiEngine@@QAE@PAVQObject@@@Z @ 266 NONAME ; RadioUiEngine::RadioUiEngine(class QObject *)
+	?setCurrentTime@RadioHistoryItem@@QAEXXZ @ 267 NONAME ; void RadioHistoryItem::setCurrentTime(void)
+	?isTagged@RadioHistoryItem@@QBE_NXZ @ 268 NONAME ; bool RadioHistoryItem::isTagged(void) const
+	?minFrequency@RadioUiEngine@@QBEIXZ @ 269 NONAME ; unsigned int RadioUiEngine::minFrequency(void) const
+	?setShowTagged@RadioHistoryModel@@QAEX_N@Z @ 270 NONAME ; void RadioHistoryModel::setShowTagged(bool)
+	?isFavorite@RadioStation@@QBE_NXZ @ 271 NONAME ; bool RadioStation::isFavorite(void) const
+	?radioTextReceived@RadioStationModel@@IAEXABVRadioStation@@@Z @ 272 NONAME ; void RadioStationModel::radioTextReceived(class RadioStation const &)
+	?staticMetaObject@RadioCarouselModel@@2UQMetaObject@@B @ 273 NONAME ; struct QMetaObject const RadioCarouselModel::staticMetaObject
+	?seekingStarted@RadioUiEngine@@IAEXH@Z @ 274 NONAME ; void RadioUiEngine::seekingStarted(int)
+	?isRecognizedByRds@RadioHistoryItem@@QBE_NXZ @ 275 NONAME ; bool RadioHistoryItem::isRecognizedByRds(void) const
+	??_ERadioStationModel@@UAE@I@Z @ 276 NONAME ; RadioStationModel::~RadioStationModel(unsigned int)
+	?openMusicStore@RadioUiEngine@@QAEXABVRadioHistoryItem@@W4MusicStore@1@@Z @ 277 NONAME ; void RadioUiEngine::openMusicStore(class RadioHistoryItem const &, enum RadioUiEngine::MusicStore)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/bwins/radiowidgetsu.def	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,247 @@
+EXPORTS
+	?trUtf8@RadioWindow@@SA?AVQString@@PBD0H@Z @ 1 NONAME ; class QString RadioWindow::trUtf8(char const *, char const *, int)
+	?qt_metacast@RadioHistoryView@@UAEPAXPBD@Z @ 2 NONAME ; void * RadioHistoryView::qt_metacast(char const *)
+	?qt_metacast@RadioFadingLabel@@UAEPAXPBD@Z @ 3 NONAME ; void * RadioFadingLabel::qt_metacast(char const *)
+	?tr@RadioBannerLabel@@SA?AVQString@@PBD0@Z @ 4 NONAME ; class QString RadioBannerLabel::tr(char const *, char const *)
+	?toggleButtons@RadioFrequencyStrip@@AAEXXZ @ 5 NONAME ; void RadioFrequencyStrip::toggleButtons(void)
+	?animateNewStation@RadioStationCarousel@@QAEXABVRadioStation@@@Z @ 6 NONAME ; void RadioStationCarousel::animateNewStation(class RadioStation const &)
+	?getStaticMetaObject@RadioBannerLabel@@SAABUQMetaObject@@XZ @ 7 NONAME ; struct QMetaObject const & RadioBannerLabel::getStaticMetaObject(void)
+	?frequencyChanged@RadioFrequencyStrip@@IAEXIH@Z @ 8 NONAME ; void RadioFrequencyStrip::frequencyChanged(unsigned int, int)
+	?toggleTagging@RadioHistoryView@@AAEXXZ @ 9 NONAME ; void RadioHistoryView::toggleTagging(void)
+	?tr@RadioMainView@@SA?AVQString@@PBD0H@Z @ 10 NONAME ; class QString RadioMainView::tr(char const *, char const *, int)
+	?rename@RadioStationsView@@AAEXXZ @ 11 NONAME ; void RadioStationsView::rename(void)
+	?gestureEvent@RadioStationCarousel@@EAEXPAVQGestureEvent@@@Z @ 12 NONAME ; void RadioStationCarousel::gestureEvent(class QGestureEvent *)
+	??1RadioBannerLabel@@UAE@XZ @ 13 NONAME ; RadioBannerLabel::~RadioBannerLabel(void)
+	?setFavoriteIcon@RadioStationCarousel@@QAEXABVHbIcon@@@Z @ 14 NONAME ; void RadioStationCarousel::setFavoriteIcon(class HbIcon const &)
+	?update@RadioStationCarousel@@AAEXABVRadioStation@@@Z @ 15 NONAME ; void RadioStationCarousel::update(class RadioStation const &)
+	?taggedIcon@RadioHistoryView@@QBE?AVHbIcon@@XZ @ 16 NONAME ; class HbIcon RadioHistoryView::taggedIcon(void) const
+	?seekingStarted@RadioMainView@@AAEXXZ @ 17 NONAME ; void RadioMainView::seekingStarted(void)
+	?addFrequencyPos@RadioFrequencyStrip@@AAEXHIPAVRadioFrequencyItem@@@Z @ 18 NONAME ; void RadioFrequencyStrip::addFrequencyPos(int, unsigned int, class RadioFrequencyItem *)
+	?trUtf8@RadioFadingLabel@@SA?AVQString@@PBD0@Z @ 19 NONAME ; class QString RadioFadingLabel::trUtf8(char const *, char const *)
+	?setScanningMode@RadioFrequencyStrip@@QAEX_N@Z @ 20 NONAME ; void RadioFrequencyStrip::setScanningMode(bool)
+	?createItemPrimitive@RadioFrequencyStrip@@EAEPAVQGraphicsItem@@PAV2@@Z @ 21 NONAME ; class QGraphicsItem * RadioFrequencyStrip::createItemPrimitive(class QGraphicsItem *)
+	??_ERadioStationsView@@UAE@I@Z @ 22 NONAME ; RadioStationsView::~RadioStationsView(unsigned int)
+	?setTextWithoutFading@RadioFadingLabel@@QAEXABVQString@@@Z @ 23 NONAME ; void RadioFadingLabel::setTextWithoutFading(class QString const &)
+	?updateAntennaStatus@RadioWindow@@AAEX_N@Z @ 24 NONAME ; void RadioWindow::updateAntennaStatus(bool)
+	?resizeEvent@RadioFrequencyStrip@@EAEXPAVQGraphicsSceneResizeEvent@@@Z @ 25 NONAME ; void RadioFrequencyStrip::resizeEvent(class QGraphicsSceneResizeEvent *)
+	?addOneSong@RadioHistoryView@@AAEXXZ @ 26 NONAME ; void RadioHistoryView::addOneSong(void)
+	?startScanning@RadioStationsView@@AAEXXZ @ 27 NONAME ; void RadioStationsView::startScanning(void)
+	?initButtons@RadioFrequencyStrip@@AAEXXZ @ 28 NONAME ; void RadioFrequencyStrip::initButtons(void)
+	?setOrientation@RadioMainView@@EAEXXZ @ 29 NONAME ; void RadioMainView::setOrientation(void)
+	?qt_metacall@RadioStationCarousel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 30 NONAME ; int RadioStationCarousel::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?leftButtonIcon@RadioFrequencyStrip@@QBE?AVHbIcon@@XZ @ 31 NONAME ; class HbIcon RadioFrequencyStrip::leftButtonIcon(void) const
+	?init@RadioStationCarousel@@QAEXAAVRadioUiLoader@@PAVRadioUiEngine@@@Z @ 32 NONAME ; void RadioStationCarousel::init(class RadioUiLoader &, class RadioUiEngine *)
+	?insertFrequency@RadioStationCarousel@@AAEXABVQModelIndex@@HH@Z @ 33 NONAME ; void RadioStationCarousel::insertFrequency(class QModelIndex const &, int, int)
+	?toggleScanning@RadioMainView@@AAEXXZ @ 34 NONAME ; void RadioMainView::toggleScanning(void)
+	?staticMetaObject@RadioMainView@@2UQMetaObject@@B @ 35 NONAME ; struct QMetaObject const RadioMainView::staticMetaObject
+	?tr@RadioBannerLabel@@SA?AVQString@@PBD0H@Z @ 36 NONAME ; class QString RadioBannerLabel::tr(char const *, char const *, int)
+	?getStaticMetaObject@RadioMainView@@SAABUQMetaObject@@XZ @ 37 NONAME ; struct QMetaObject const & RadioMainView::getStaticMetaObject(void)
+	?prepareToRemoveFrequency@RadioStationCarousel@@AAEXABVQModelIndex@@HH@Z @ 38 NONAME ; void RadioStationCarousel::prepareToRemoveFrequency(class QModelIndex const &, int, int)
+	?setAutoScrollTime@RadioStationCarousel@@QAEXH@Z @ 39 NONAME ; void RadioStationCarousel::setAutoScrollTime(int)
+	?setLeftButtonIcon@RadioFrequencyStrip@@QAEXABVHbIcon@@@Z @ 40 NONAME ; void RadioFrequencyStrip::setLeftButtonIcon(class HbIcon const &)
+	?setItemVisible@RadioStationCarousel@@QAEX_N@Z @ 41 NONAME ; void RadioStationCarousel::setItemVisible(bool)
+	?trUtf8@RadioStationCarousel@@SA?AVQString@@PBD0@Z @ 42 NONAME ; class QString RadioStationCarousel::trUtf8(char const *, char const *)
+	?tr@RadioStationCarousel@@SA?AVQString@@PBD0@Z @ 43 NONAME ; class QString RadioStationCarousel::tr(char const *, char const *)
+	?skip@RadioStationCarousel@@AAEXW4Mode@StationSkip@@@Z @ 44 NONAME ; void RadioStationCarousel::skip(enum StationSkip::Mode)
+	?selectorPos@RadioFrequencyStrip@@ABEHXZ @ 45 NONAME ; int RadioFrequencyStrip::selectorPos(void) const
+	?currentStationItem@RadioStationCarousel@@AAEPAVRadioStationItem@@XZ @ 46 NONAME ; class RadioStationItem * RadioStationCarousel::currentStationItem(void)
+	??1RadioWindow@@UAE@XZ @ 47 NONAME ; RadioWindow::~RadioWindow(void)
+	?updateFrequencies@RadioStationCarousel@@AAEXXZ @ 48 NONAME ; void RadioStationCarousel::updateFrequencies(void)
+	?metaObject@RadioBannerLabel@@UBEPBUQMetaObject@@XZ @ 49 NONAME ; struct QMetaObject const * RadioBannerLabel::metaObject(void) const
+	?skipRequested@RadioFrequencyStrip@@IAEXH@Z @ 50 NONAME ; void RadioFrequencyStrip::skipRequested(int)
+	?setTaggedIcon@RadioHistoryView@@QAEXABVHbIcon@@@Z @ 51 NONAME ; void RadioHistoryView::setTaggedIcon(class HbIcon const &)
+	?setText@RadioFadingLabel@@QAEXABVQString@@@Z @ 52 NONAME ; void RadioFadingLabel::setText(class QString const &)
+	?setNowPlayingIcon@RadioStationsView@@QAEXABVHbIcon@@@Z @ 53 NONAME ; void RadioStationsView::setNowPlayingIcon(class HbIcon const &)
+	?mousePressEvent@RadioStationCarousel@@EAEXPAVQGraphicsSceneMouseEvent@@@Z @ 54 NONAME ; void RadioStationCarousel::mousePressEvent(class QGraphicsSceneMouseEvent *)
+	?trUtf8@RadioFrequencyStrip@@SA?AVQString@@PBD0@Z @ 55 NONAME ; class QString RadioFrequencyStrip::trUtf8(char const *, char const *)
+	?tr@RadioStationsView@@SA?AVQString@@PBD0@Z @ 56 NONAME ; class QString RadioStationsView::tr(char const *, char const *)
+	?favoriteIcon@RadioStationCarousel@@QBE?AVHbIcon@@XZ @ 57 NONAME ; class HbIcon RadioStationCarousel::favoriteIcon(void) const
+	?qt_metacall@RadioBannerLabel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 58 NONAME ; int RadioBannerLabel::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?orientationSection@RadioWindow@@QAE?AVQString@@XZ @ 59 NONAME ; class QString RadioWindow::orientationSection(void)
+	?updateStation@RadioFrequencyStrip@@AAEXABVQModelIndex@@HH@Z @ 60 NONAME ; void RadioFrequencyStrip::updateStation(class QModelIndex const &, int, int)
+	?setScanningMode@RadioMainView@@QAEX_N@Z @ 61 NONAME ; void RadioMainView::setScanningMode(bool)
+	?favoriteIcon@RadioStationsView@@QBE?AVHbIcon@@XZ @ 62 NONAME ; class HbIcon RadioStationsView::favoriteIcon(void) const
+	?trUtf8@RadioMainView@@SA?AVQString@@PBD0H@Z @ 63 NONAME ; class QString RadioMainView::trUtf8(char const *, char const *, int)
+	??1RadioFrequencyStrip@@UAE@XZ @ 64 NONAME ; RadioFrequencyStrip::~RadioFrequencyStrip(void)
+	?trUtf8@RadioStationsView@@SA?AVQString@@PBD0H@Z @ 65 NONAME ; class QString RadioStationsView::trUtf8(char const *, char const *, int)
+	?tr@RadioMainView@@SA?AVQString@@PBD0@Z @ 66 NONAME ; class QString RadioMainView::tr(char const *, char const *)
+	?updateFavorites@RadioFrequencyStrip@@AAEXPAVRadioFrequencyItem@@@Z @ 67 NONAME ; void RadioFrequencyStrip::updateFavorites(class RadioFrequencyItem *)
+	?showContextMenu@RadioHistoryView@@AAEXABVQModelIndex@@@Z @ 68 NONAME ; void RadioHistoryView::showContextMenu(class QModelIndex const &)
+	?changeEvent@RadioFrequencyStrip@@EAEXPAVQEvent@@@Z @ 69 NONAME ; void RadioFrequencyStrip::changeEvent(class QEvent *)
+	?updatePos@RadioStationCarousel@@AAEXH@Z @ 70 NONAME ; void RadioStationCarousel::updatePos(int)
+	?staticMetaObject@RadioStationCarousel@@2UQMetaObject@@B @ 71 NONAME ; struct QMetaObject const RadioStationCarousel::staticMetaObject
+	?qt_metacall@RadioFadingLabel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 72 NONAME ; int RadioFadingLabel::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?finishScanning@RadioStationsView@@AAEXXZ @ 73 NONAME ; void RadioStationsView::finishScanning(void)
+	??0RadioFrequencyStrip@@QAE@XZ @ 74 NONAME ; RadioFrequencyStrip::RadioFrequencyStrip(void)
+	?trUtf8@RadioBannerLabel@@SA?AVQString@@PBD0H@Z @ 75 NONAME ; class QString RadioBannerLabel::trUtf8(char const *, char const *, int)
+	?skip@RadioMainView@@AAEXH@Z @ 76 NONAME ; void RadioMainView::skip(int)
+	??0RadioMainView@@QAE@XZ @ 77 NONAME ; RadioMainView::RadioMainView(void)
+	?setRightButtonIcon@RadioFrequencyStrip@@QAEXABVHbIcon@@@Z @ 78 NONAME ; void RadioFrequencyStrip::setRightButtonIcon(class HbIcon const &)
+	?openContextMenu@RadioStationCarousel@@AAEXPAVHbAbstractViewItem@@ABVQPointF@@@Z @ 79 NONAME ; void RadioStationCarousel::openContextMenu(class HbAbstractViewItem *, class QPointF const &)
+	?staticMetaObject@RadioStationsView@@2UQMetaObject@@B @ 80 NONAME ; struct QMetaObject const RadioStationsView::staticMetaObject
+	??_ERadioBannerLabel@@UAE@I@Z @ 81 NONAME ; RadioBannerLabel::~RadioBannerLabel(unsigned int)
+	??_ERadioMainView@@UAE@I@Z @ 82 NONAME ; RadioMainView::~RadioMainView(unsigned int)
+	??_ERadioWindow@@UAE@I@Z @ 83 NONAME ; RadioWindow::~RadioWindow(unsigned int)
+	?tr@RadioFrequencyStrip@@SA?AVQString@@PBD0@Z @ 84 NONAME ; class QString RadioFrequencyStrip::tr(char const *, char const *)
+	?qt_metacast@RadioStationsView@@UAEPAXPBD@Z @ 85 NONAME ; void * RadioStationsView::qt_metacast(char const *)
+	?initSelector@RadioFrequencyStrip@@AAEXXZ @ 86 NONAME ; void RadioFrequencyStrip::initSelector(void)
+	?addSongs@RadioHistoryView@@AAEXXZ @ 87 NONAME ; void RadioHistoryView::addSongs(void)
+	?qt_metacall@RadioWindow@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 88 NONAME ; int RadioWindow::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?qt_metacall@RadioFrequencyStrip@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 89 NONAME ; int RadioFrequencyStrip::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?openOtherStore@RadioHistoryView@@AAEXXZ @ 90 NONAME ; void RadioHistoryView::openOtherStore(void)
+	?metaObject@RadioFrequencyStrip@@UBEPBUQMetaObject@@XZ @ 91 NONAME ; struct QMetaObject const * RadioFrequencyStrip::metaObject(void) const
+	?startEffect@RadioFadingLabel@@AAEXABVQString@@PBD@Z @ 92 NONAME ; void RadioFadingLabel::startEffect(class QString const &, char const *)
+	?trUtf8@RadioStationsView@@SA?AVQString@@PBD0@Z @ 93 NONAME ; class QString RadioStationsView::trUtf8(char const *, char const *)
+	?qt_metacast@RadioBannerLabel@@UAEPAXPBD@Z @ 94 NONAME ; void * RadioBannerLabel::qt_metacast(char const *)
+	?qt_metacall@RadioStationsView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 95 NONAME ; int RadioStationsView::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?historyModel@RadioHistoryView@@ABEAAVRadioHistoryModel@@XZ @ 96 NONAME ; class RadioHistoryModel & RadioHistoryView::historyModel(void) const
+	?activateHistoryView@RadioWindow@@QAEXXZ @ 97 NONAME ; void RadioWindow::activateHistoryView(void)
+	??_ERadioStationCarousel@@UAE@I@Z @ 98 NONAME ; RadioStationCarousel::~RadioStationCarousel(unsigned int)
+	?initPositions@RadioFrequencyStrip@@AAEXXZ @ 99 NONAME ; void RadioFrequencyStrip::initPositions(void)
+	?carouselModel@RadioStationCarousel@@ABEPAVRadioCarouselModel@@XZ @ 100 NONAME ; class RadioCarouselModel * RadioStationCarousel::carouselModel(void) const
+	?tr@RadioFadingLabel@@SA?AVQString@@PBD0@Z @ 101 NONAME ; class QString RadioFadingLabel::tr(char const *, char const *)
+	?getStaticMetaObject@RadioFadingLabel@@SAABUQMetaObject@@XZ @ 102 NONAME ; struct QMetaObject const & RadioFadingLabel::getStaticMetaObject(void)
+	?trUtf8@RadioHistoryView@@SA?AVQString@@PBD0@Z @ 103 NONAME ; class QString RadioHistoryView::trUtf8(char const *, char const *)
+	?metaObject@RadioMainView@@UBEPBUQMetaObject@@XZ @ 104 NONAME ; struct QMetaObject const * RadioMainView::metaObject(void) const
+	?clearList@RadioHistoryView@@AAEXXZ @ 105 NONAME ; void RadioHistoryView::clearList(void)
+	?qt_metacast@RadioWindow@@UAEPAXPBD@Z @ 106 NONAME ; void * RadioWindow::qt_metacast(char const *)
+	?trimHtml@RadioFadingLabel@@AAE?AVQString@@ABV2@@Z @ 107 NONAME ; class QString RadioFadingLabel::trimHtml(class QString const &)
+	?tr@RadioWindow@@SA?AVQString@@PBD0@Z @ 108 NONAME ; class QString RadioWindow::tr(char const *, char const *)
+	?nonTaggedIcon@RadioHistoryView@@QBE?AVHbIcon@@XZ @ 109 NONAME ; class HbIcon RadioHistoryView::nonTaggedIcon(void) const
+	?mouseReleaseEvent@RadioFrequencyStrip@@EAEXPAVQGraphicsSceneMouseEvent@@@Z @ 110 NONAME ; void RadioFrequencyStrip::mouseReleaseEvent(class QGraphicsSceneMouseEvent *)
+	?updateItemPrimitive@RadioFrequencyStrip@@EAEXPAVQGraphicsItem@@H@Z @ 111 NONAME ; void RadioFrequencyStrip::updateItemPrimitive(class QGraphicsItem *, int)
+	?showErrorMessage@RadioWindow@@QAEXABVQString@@@Z @ 112 NONAME ; void RadioWindow::showErrorMessage(class QString const &)
+	?getStaticMetaObject@RadioFrequencyStrip@@SAABUQMetaObject@@XZ @ 113 NONAME ; struct QMetaObject const & RadioFrequencyStrip::getStaticMetaObject(void)
+	?removeFrequency@RadioStationCarousel@@AAEXABVQModelIndex@@HH@Z @ 114 NONAME ; void RadioStationCarousel::removeFrequency(class QModelIndex const &, int, int)
+	??0RadioFadingLabel@@QAE@PAVQGraphicsItem@@@Z @ 115 NONAME ; RadioFadingLabel::RadioFadingLabel(class QGraphicsItem *)
+	?activateView@RadioWindow@@AAEXAAV?$QPointer@VRadioViewBase@@@@ABVQString@@V?$QFlags@W4ViewSwitchFlag@Hb@@@@@Z @ 116 NONAME ; void RadioWindow::activateView(class QPointer<class RadioViewBase> &, class QString const &, class QFlags<enum Hb::ViewSwitchFlag>)
+	?initListView@RadioStationsView@@AAEXXZ @ 117 NONAME ; void RadioStationsView::initListView(void)
+	?initModel@RadioFrequencyStrip@@AAEXXZ @ 118 NONAME ; void RadioFrequencyStrip::initModel(void)
+	?scrollToIndex@RadioStationCarousel@@AAEXABVQModelIndex@@V?$QFlags@W4ScrollFlag@RadioStationCarousel@@@@@Z @ 119 NONAME ; void RadioStationCarousel::scrollToIndex(class QModelIndex const &, class QFlags<enum RadioStationCarousel::ScrollFlag>)
+	??0RadioStationsView@@QAE@XZ @ 120 NONAME ; RadioStationsView::RadioStationsView(void)
+	?frequency@RadioFrequencyStrip@@QBEIXZ @ 121 NONAME ; unsigned int RadioFrequencyStrip::frequency(void) const
+	?updateItems@RadioFrequencyStrip@@AAEXXZ @ 122 NONAME ; void RadioFrequencyStrip::updateItems(void)
+	??0RadioBannerLabel@@QAE@PAVQGraphicsItem@@@Z @ 123 NONAME ; RadioBannerLabel::RadioBannerLabel(class QGraphicsItem *)
+	??1RadioStationCarousel@@UAE@XZ @ 124 NONAME ; RadioStationCarousel::~RadioStationCarousel(void)
+	?deckButtonPressed@RadioHistoryView@@AAEXXZ @ 125 NONAME ; void RadioHistoryView::deckButtonPressed(void)
+	?setNonTaggedIcon@RadioHistoryView@@QAEXABVHbIcon@@@Z @ 126 NONAME ; void RadioHistoryView::setNonTaggedIcon(class HbIcon const &)
+	??_ERadioFrequencyStrip@@UAE@I@Z @ 127 NONAME ; RadioFrequencyStrip::~RadioFrequencyStrip(unsigned int)
+	?uiEngine@RadioWindow@@QAEAAVRadioUiEngine@@XZ @ 128 NONAME ; class RadioUiEngine & RadioWindow::uiEngine(void)
+	?trUtf8@RadioMainView@@SA?AVQString@@PBD0@Z @ 129 NONAME ; class QString RadioMainView::trUtf8(char const *, char const *)
+	?setCarouselModel@RadioStationCarousel@@QAEXPAVRadioCarouselModel@@@Z @ 130 NONAME ; void RadioStationCarousel::setCarouselModel(class RadioCarouselModel *)
+	?setFadingEnabled@RadioFadingLabel@@QAEX_N@Z @ 131 NONAME ; void RadioFadingLabel::setFadingEnabled(bool)
+	?showVolumeLevel@RadioWindow@@AAEXH@Z @ 132 NONAME ; void RadioWindow::showVolumeLevel(int)
+	?frequencyChanged@RadioStationCarousel@@IAEXIH@Z @ 133 NONAME ; void RadioStationCarousel::frequencyChanged(unsigned int, int)
+	?mousePressEvent@RadioFrequencyStrip@@EAEXPAVQGraphicsSceneMouseEvent@@@Z @ 134 NONAME ; void RadioFrequencyStrip::mousePressEvent(class QGraphicsSceneMouseEvent *)
+	?getStaticMetaObject@RadioWindow@@SAABUQMetaObject@@XZ @ 135 NONAME ; struct QMetaObject const & RadioWindow::getStaticMetaObject(void)
+	?trUtf8@RadioWindow@@SA?AVQString@@PBD0@Z @ 136 NONAME ; class QString RadioWindow::trUtf8(char const *, char const *)
+	?timerFired@RadioStationCarousel@@AAEXXZ @ 137 NONAME ; void RadioStationCarousel::timerFired(void)
+	?drawPixmap@RadioFrequencyStrip@@AAE?AVQPixmap@@IV?$QList@VRadioStation@@@@PAVRadioFrequencyItem@@@Z @ 138 NONAME ; class QPixmap RadioFrequencyStrip::drawPixmap(unsigned int, class QList<class RadioStation>, class RadioFrequencyItem *)
+	?getStaticMetaObject@RadioStationsView@@SAABUQMetaObject@@XZ @ 139 NONAME ; struct QMetaObject const & RadioStationsView::getStaticMetaObject(void)
+	?initEmptyItems@RadioFrequencyStrip@@AAEXXZ @ 140 NONAME ; void RadioFrequencyStrip::initEmptyItems(void)
+	?listItemClicked@RadioStationsView@@AAEXABVQModelIndex@@@Z @ 141 NONAME ; void RadioStationsView::listItemClicked(class QModelIndex const &)
+	?updateCurrentItem@RadioStationCarousel@@QAEXXZ @ 142 NONAME ; void RadioStationCarousel::updateCurrentItem(void)
+	?updateAntennaStatus@RadioStationsView@@AAEX_N@Z @ 143 NONAME ; void RadioStationsView::updateAntennaStatus(bool)
+	?tr@RadioFadingLabel@@SA?AVQString@@PBD0H@Z @ 144 NONAME ; class QString RadioFadingLabel::tr(char const *, char const *, int)
+	??0RadioWindow@@QAE@PAVQWidget@@@Z @ 145 NONAME ; RadioWindow::RadioWindow(class QWidget *)
+	?updateRadioText@RadioStationCarousel@@AAEXABVRadioStation@@@Z @ 146 NONAME ; void RadioStationCarousel::updateRadioText(class RadioStation const &)
+	?updateAntennaStatus@RadioStationCarousel@@QAEX_N@Z @ 147 NONAME ; void RadioStationCarousel::updateAntennaStatus(bool)
+	?paint@RadioBannerLabel@@EAEXPAVQPainter@@PBVQStyleOptionGraphicsItem@@PAVQWidget@@@Z @ 148 NONAME ; void RadioBannerLabel::paint(class QPainter *, class QStyleOptionGraphicsItem const *, class QWidget *)
+	?updateFavorite@RadioFrequencyStrip@@QAEXABVRadioStation@@@Z @ 149 NONAME ; void RadioFrequencyStrip::updateFavorite(class RadioStation const &)
+	?setInfoText@RadioStationCarousel@@QAEXW4Type@CarouselInfoText@@@Z @ 150 NONAME ; void RadioStationCarousel::setInfoText(enum CarouselInfoText::Type)
+	?initToLastTunedFrequency@RadioStationCarousel@@AAEXXZ @ 151 NONAME ; void RadioStationCarousel::initToLastTunedFrequency(void)
+	?staticMetaObject@RadioFadingLabel@@2UQMetaObject@@B @ 152 NONAME ; struct QMetaObject const RadioFadingLabel::staticMetaObject
+	?trUtf8@RadioFrequencyStrip@@SA?AVQString@@PBD0H@Z @ 153 NONAME ; class QString RadioFrequencyStrip::trUtf8(char const *, char const *, int)
+	?tr@RadioFrequencyStrip@@SA?AVQString@@PBD0H@Z @ 154 NONAME ; class QString RadioFrequencyStrip::tr(char const *, char const *, int)
+	?trUtf8@RadioBannerLabel@@SA?AVQString@@PBD0@Z @ 155 NONAME ; class QString RadioBannerLabel::trUtf8(char const *, char const *)
+	?setFrequencyFromWidget@RadioMainView@@AAEXIH@Z @ 156 NONAME ; void RadioMainView::setFrequencyFromWidget(unsigned int, int)
+	?getStaticMetaObject@RadioStationCarousel@@SAABUQMetaObject@@XZ @ 157 NONAME ; struct QMetaObject const & RadioStationCarousel::getStaticMetaObject(void)
+	?metaObject@RadioFadingLabel@@UBEPBUQMetaObject@@XZ @ 158 NONAME ; struct QMetaObject const * RadioFadingLabel::metaObject(void) const
+	?metaObject@RadioWindow@@UBEPBUQMetaObject@@XZ @ 159 NONAME ; struct QMetaObject const * RadioWindow::metaObject(void) const
+	?staticMetaObject@RadioFrequencyStrip@@2UQMetaObject@@B @ 160 NONAME ; struct QMetaObject const RadioFrequencyStrip::staticMetaObject
+	?updateClampingStyle@RadioStationCarousel@@AAEXXZ @ 161 NONAME ; void RadioStationCarousel::updateClampingStyle(void)
+	?tr@RadioStationsView@@SA?AVQString@@PBD0H@Z @ 162 NONAME ; class QString RadioStationsView::tr(char const *, char const *, int)
+	?autoScrollTime@RadioStationCarousel@@QBEHXZ @ 163 NONAME ; int RadioStationCarousel::autoScrollTime(void) const
+	?handleRightButton@RadioFrequencyStrip@@AAEXXZ @ 164 NONAME ; void RadioFrequencyStrip::handleRightButton(void)
+	?initCurrentStationItem@RadioStationCarousel@@AAEXXZ @ 165 NONAME ; void RadioStationCarousel::initCurrentStationItem(void)
+	?qt_metacast@RadioStationCarousel@@UAEPAXPBD@Z @ 166 NONAME ; void * RadioStationCarousel::qt_metacast(char const *)
+	?clearList@RadioStationsView@@AAEXXZ @ 167 NONAME ; void RadioStationsView::clearList(void)
+	?openOviStore@RadioHistoryView@@AAEXXZ @ 168 NONAME ; void RadioHistoryView::openOviStore(void)
+	?showEvent@RadioFrequencyStrip@@EAEXPAVQShowEvent@@@Z @ 169 NONAME ; void RadioFrequencyStrip::showEvent(class QShowEvent *)
+	?tr@RadioWindow@@SA?AVQString@@PBD0H@Z @ 170 NONAME ; class QString RadioWindow::tr(char const *, char const *, int)
+	?seekRequested@RadioFrequencyStrip@@IAEXH@Z @ 171 NONAME ; void RadioFrequencyStrip::seekRequested(int)
+	?handleLongRightButton@RadioFrequencyStrip@@AAEXXZ @ 172 NONAME ; void RadioFrequencyStrip::handleLongRightButton(void)
+	?setFrequency@RadioFrequencyStrip@@QAEXIH@Z @ 173 NONAME ; void RadioFrequencyStrip::setFrequency(unsigned int, int)
+	?init@RadioHistoryView@@EAEXXZ @ 174 NONAME ; void RadioHistoryView::init(void)
+	?setFrequencyFromEngine@RadioMainView@@AAEXIH@Z @ 175 NONAME ; void RadioMainView::setFrequencyFromEngine(unsigned int, int)
+	?tr@RadioHistoryView@@SA?AVQString@@PBD0H@Z @ 176 NONAME ; class QString RadioHistoryView::tr(char const *, char const *, int)
+	?setFavoriteIcon@RadioStationsView@@QAEXABVHbIcon@@@Z @ 177 NONAME ; void RadioStationsView::setFavoriteIcon(class HbIcon const &)
+	??0RadioHistoryView@@QAE@XZ @ 178 NONAME ; RadioHistoryView::RadioHistoryView(void)
+	?metaObject@RadioStationCarousel@@UBEPBUQMetaObject@@XZ @ 179 NONAME ; struct QMetaObject const * RadioStationCarousel::metaObject(void) const
+	?effectFinished@RadioFadingLabel@@AAEXUEffectStatus@HbEffect@@@Z @ 180 NONAME ; void RadioFadingLabel::effectFinished(struct HbEffect::EffectStatus)
+	?updateOrientation@RadioWindow@@AAEXW4Orientation@Qt@@@Z @ 181 NONAME ; void RadioWindow::updateOrientation(enum Qt::Orientation)
+	?updateCurrentStation@RadioStationsView@@AAEXXZ @ 182 NONAME ; void RadioStationsView::updateCurrentStation(void)
+	?setOrientation@RadioHistoryView@@EAEXXZ @ 183 NONAME ; void RadioHistoryView::setOrientation(void)
+	?showButtons@RadioFrequencyStrip@@AAEXXZ @ 184 NONAME ; void RadioFrequencyStrip::showButtons(void)
+	?nonFavoriteIcon@RadioStationCarousel@@QBE?AVHbIcon@@XZ @ 185 NONAME ; class HbIcon RadioStationCarousel::nonFavoriteIcon(void) const
+	?scrollToFrequency@RadioFrequencyStrip@@AAEXIH@Z @ 186 NONAME ; void RadioFrequencyStrip::scrollToFrequency(unsigned int, int)
+	?uiEngine@RadioStationCarousel@@QAEPAVRadioUiEngine@@XZ @ 187 NONAME ; class RadioUiEngine * RadioStationCarousel::uiEngine(void)
+	?trUtf8@RadioFadingLabel@@SA?AVQString@@PBD0H@Z @ 188 NONAME ; class QString RadioFadingLabel::trUtf8(char const *, char const *, int)
+	?scrollPosChanged@RadioFrequencyStrip@@EAEXVQPointF@@@Z @ 189 NONAME ; void RadioFrequencyStrip::scrollPosChanged(class QPointF)
+	?deleteStation@RadioStationsView@@AAEXXZ @ 190 NONAME ; void RadioStationsView::deleteStation(void)
+	?activateMainView@RadioWindow@@QAEXXZ @ 191 NONAME ; void RadioWindow::activateMainView(void)
+	?rightButtonIcon@RadioFrequencyStrip@@QBE?AVHbIcon@@XZ @ 192 NONAME ; class HbIcon RadioFrequencyStrip::rightButtonIcon(void) const
+	?setScanningMode@RadioStationCarousel@@QAEX_N@Z @ 193 NONAME ; void RadioStationCarousel::setScanningMode(bool)
+	?setNonFavoriteIcon@RadioStationCarousel@@QAEXABVHbIcon@@@Z @ 194 NONAME ; void RadioStationCarousel::setNonFavoriteIcon(class HbIcon const &)
+	??1RadioFadingLabel@@UAE@XZ @ 195 NONAME ; RadioFadingLabel::~RadioFadingLabel(void)
+	?isInScanningMode@RadioStationCarousel@@QBE_NXZ @ 196 NONAME ; bool RadioStationCarousel::isInScanningMode(void) const
+	?tr@RadioHistoryView@@SA?AVQString@@PBD0@Z @ 197 NONAME ; class QString RadioHistoryView::tr(char const *, char const *)
+	?staticMetaObject@RadioBannerLabel@@2UQMetaObject@@B @ 198 NONAME ; struct QMetaObject const RadioBannerLabel::staticMetaObject
+	?checkIllegalPos@RadioFrequencyStrip@@AAEXXZ @ 199 NONAME ; void RadioFrequencyStrip::checkIllegalPos(void)
+	?setFrequency@RadioStationCarousel@@QAEXIH@Z @ 200 NONAME ; void RadioStationCarousel::setFrequency(unsigned int, int)
+	?getStaticMetaObject@RadioHistoryView@@SAABUQMetaObject@@XZ @ 201 NONAME ; struct QMetaObject const & RadioHistoryView::getStaticMetaObject(void)
+	?activateStationsView@RadioWindow@@QAEXXZ @ 202 NONAME ; void RadioWindow::activateStationsView(void)
+	?isAntennaAttached@RadioStationCarousel@@QBE_NXZ @ 203 NONAME ; bool RadioStationCarousel::isAntennaAttached(void) const
+	?metaObject@RadioHistoryView@@UBEPBUQMetaObject@@XZ @ 204 NONAME ; struct QMetaObject const * RadioHistoryView::metaObject(void) const
+	?tr@RadioStationCarousel@@SA?AVQString@@PBD0H@Z @ 205 NONAME ; class QString RadioStationCarousel::tr(char const *, char const *, int)
+	??_ERadioHistoryView@@UAE@I@Z @ 206 NONAME ; RadioHistoryView::~RadioHistoryView(unsigned int)
+	?updateAudioRoute@RadioMainView@@AAEX_N@Z @ 207 NONAME ; void RadioMainView::updateAudioRoute(bool)
+	?gestureEvent@RadioFrequencyStrip@@EAEXPAVQGestureEvent@@@Z @ 208 NONAME ; void RadioFrequencyStrip::gestureEvent(class QGestureEvent *)
+	?initView@RadioWindow@@AAEXXZ @ 209 NONAME ; void RadioWindow::initView(void)
+	?qt_metacall@RadioHistoryView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 210 NONAME ; int RadioHistoryView::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?trUtf8@RadioStationCarousel@@SA?AVQString@@PBD0H@Z @ 211 NONAME ; class QString RadioStationCarousel::trUtf8(char const *, char const *, int)
+	?nowPlayingIcon@RadioStationsView@@QBE?AVHbIcon@@XZ @ 212 NONAME ; class HbIcon RadioStationsView::nowPlayingIcon(void) const
+	?toggleFavorite@RadioStationsView@@AAEXXZ @ 213 NONAME ; void RadioStationsView::toggleFavorite(void)
+	?qt_metacast@RadioMainView@@UAEPAXPBD@Z @ 214 NONAME ; void * RadioMainView::qt_metacast(char const *)
+	??1RadioStationsView@@UAE@XZ @ 215 NONAME ; RadioStationsView::~RadioStationsView(void)
+	?handleLongLeftButton@RadioFrequencyStrip@@AAEXXZ @ 216 NONAME ; void RadioFrequencyStrip::handleLongLeftButton(void)
+	?init@RadioMainView@@EAEXXZ @ 217 NONAME ; void RadioMainView::init(void)
+	?showEvent@RadioStationsView@@EAEXPAVQShowEvent@@@Z @ 218 NONAME ; void RadioStationsView::showEvent(class QShowEvent *)
+	??1RadioMainView@@UAE@XZ @ 219 NONAME ; RadioMainView::~RadioMainView(void)
+	?hideButtons@RadioFrequencyStrip@@AAEXXZ @ 220 NONAME ; void RadioFrequencyStrip::hideButtons(void)
+	?emitFrequencyChanged@RadioFrequencyStrip@@AAEXI@Z @ 221 NONAME ; void RadioFrequencyStrip::emitFrequencyChanged(unsigned int)
+	?handleLeftButton@RadioFrequencyStrip@@AAEXXZ @ 222 NONAME ; void RadioFrequencyStrip::handleLeftButton(void)
+	??_ERadioFadingLabel@@UAE@I@Z @ 223 NONAME ; RadioFadingLabel::~RadioFadingLabel(unsigned int)
+	?trUtf8@RadioHistoryView@@SA?AVQString@@PBD0H@Z @ 224 NONAME ; class QString RadioHistoryView::trUtf8(char const *, char const *, int)
+	?init@RadioFrequencyStrip@@QAEXPAVRadioUiEngine@@@Z @ 225 NONAME ; void RadioFrequencyStrip::init(class RadioUiEngine *)
+	?init@RadioStationsView@@EAEXXZ @ 226 NONAME ; void RadioStationsView::init(void)
+	?updateVisibilities@RadioHistoryView@@AAEXXZ @ 227 NONAME ; void RadioHistoryView::updateVisibilities(void)
+	?updateControlVisibilities@RadioStationsView@@AAEXXZ @ 228 NONAME ; void RadioStationsView::updateControlVisibilities(void)
+	?init@RadioWindow@@QAEXXZ @ 229 NONAME ; void RadioWindow::init(void)
+	?listItemLongPressed@RadioStationsView@@AAEXPAVHbAbstractViewItem@@ABVQPointF@@@Z @ 230 NONAME ; void RadioStationsView::listItemLongPressed(class HbAbstractViewItem *, class QPointF const &)
+	?qt_metacall@RadioMainView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 231 NONAME ; int RadioMainView::qt_metacall(enum QMetaObject::Call, int, void * *)
+	??1RadioHistoryView@@UAE@XZ @ 232 NONAME ; RadioHistoryView::~RadioHistoryView(void)
+	?deckButtonPressed@RadioStationsView@@AAEXXZ @ 233 NONAME ; void RadioStationsView::deckButtonPressed(void)
+	?qt_metacast@RadioFrequencyStrip@@UAEPAXPBD@Z @ 234 NONAME ; void * RadioFrequencyStrip::qt_metacast(char const *)
+	??0RadioStationCarousel@@QAE@PAVRadioUiEngine@@@Z @ 235 NONAME ; RadioStationCarousel::RadioStationCarousel(class RadioUiEngine *)
+	?staticMetaObject@RadioWindow@@2UQMetaObject@@B @ 236 NONAME ; struct QMetaObject const RadioWindow::staticMetaObject
+	?staticMetaObject@RadioHistoryView@@2UQMetaObject@@B @ 237 NONAME ; struct QMetaObject const RadioHistoryView::staticMetaObject
+	?metaObject@RadioStationsView@@UBEPBUQMetaObject@@XZ @ 238 NONAME ; struct QMetaObject const * RadioStationsView::metaObject(void) const
+	?clearInfoText@RadioStationCarousel@@QAEXXZ @ 239 NONAME ; void RadioStationCarousel::clearInfoText(void)
+	?cleanRdsData@RadioStationCarousel@@QAEXXZ @ 240 NONAME ; void RadioStationCarousel::cleanRdsData(void)
+	?scanAnimationFinished@RadioStationCarousel@@IAEXXZ @ 241 NONAME ; void RadioStationCarousel::scanAnimationFinished(void)
+	?userAccepted@RadioMainView@@EAEXXZ @ 242 NONAME ; void RadioMainView::userAccepted(void)
+	?userAccepted@RadioStationsView@@EAEXXZ @ 243 NONAME ; void RadioStationsView::userAccepted(void)
+	?renameDone@RadioStationsView@@AAEXPAVHbAction@@@Z @ 244 NONAME ; void RadioStationsView::renameDone(class HbAction *)
+	?userAccepted@RadioHistoryView@@EAEXXZ @ 245 NONAME ; void RadioHistoryView::userAccepted(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/commoninc/radio_global.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,183 @@
+/*
+* 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 RADIO_GLOBAL_H_
+#define RADIO_GLOBAL_H_
+
+// System includes
+#include <QtGlobal>
+
+// Constants
+
+/**
+ * Radio frequency multiplier
+ */
+const int KFrequencyMultiplier = 1000000;
+
+const int KOneHertz = KFrequencyMultiplier;
+
+/**
+ * Desired amount of steps in the volume control in the UI
+ */
+const int KMaximumVolumeLevel = 20;
+
+/**
+ * Id of the offline profile
+ */
+const int KOfflineProfileId = 5;
+
+/**
+ * Radio Text Plus tag ids
+ */
+namespace RtPlus
+{
+    enum Tag { Dummy = 0, Title = 1, Artist = 4, Homepage = 39 };
+}
+
+namespace Seeking
+{
+    enum Direction
+    {
+        Down,
+        Up
+    };
+
+    enum State
+    {
+        NotSeeking,
+        SeekingUp,
+        SeekingDown
+    };
+}
+
+namespace StationSkip
+{
+    enum Mode
+    {
+        Previous,
+        Next,
+        PreviousFavorite,
+        NextFavorite
+    };
+}
+
+namespace TuneReason
+{
+    enum Reason
+    {
+        Unspecified,
+        FrequencyStrip,
+        StationCarousel,
+        StationsList,
+        Skip,
+        Seek,
+        StationScanInitialization,
+        StationScan,
+    };
+}
+
+namespace RadioRegion
+{
+    enum Region
+    {
+        None = -1,
+        Default,
+        Japan,
+        America,
+        Poland
+    };
+}
+
+namespace GenreEurope
+{
+    enum Europe
+    {
+        RdsNone,
+        RdsNews,
+        RdsCurrentAffairs,
+        RdsInformation,
+        RdsSport,
+        RdsEducation,
+        RdsDrama,
+        RdsCulture,
+        RdsScience,
+        RdsVariedSpeech,
+        RdsPopMusic,
+        RdsRockMusic,
+        RdsEasyListening,
+        RdsLightClassical,
+        RdsSeriousClassical,
+        RdsOtherMusic,
+        RdsWeather,
+        RdsFinance,
+        RdsChildrensProgrammes,
+        RdsSocialAffairs,
+        RdsReligion,
+        RdsPhoneIn,
+        RdsTravel,
+        RdsLeisure,
+        RdsJazzMusic,
+        RdsCountryMusic,
+        RdsNationalMusic,
+        RdsOldiesMusic,
+        RdsFolkMusic,
+        RdsDocumentary,
+        RdsAlarmTest,
+        RdsAlarm
+    };
+}
+
+namespace GenreAmerica
+{
+    enum America
+    {
+        RbdsNone,
+        RbdsNews,
+        RbdsInformation,
+        RbdsSports,
+        RbdsTalk,
+        RbdsRock,
+        RbdsClassicRock,
+        RbdsAdultHits,
+        RbdsSoftRock,
+        RbdsTop40,
+        RbdsCountry,
+        RbdsOldies,
+        RbdsSoft,
+        RbdsNostalgia,
+        RbdsJazz,
+        RbdsClassical,
+        RbdsRhythmAndBlues,
+        RbdsSoftRhythmAndBlues,
+        RbdsLanguage,
+        RbdsReligiousMusic,
+        RbdsReligiousTalk,
+        RbdsPersonality,
+        RbdsPublic,
+        RbdsCollege,
+        RbdsUnassigned1,
+        RbdsUnassigned2,
+        RbdsUnassigned3,
+        RbdsUnassigned4,
+        RbdsUnassigned5,
+        RbdsWeather,
+        RbdsEmergencyTest,
+        RbdsEmergency
+    };
+}
+
+#endif // RADIO_GLOBAL_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/commoninc/radiologger.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,294 @@
+/*
+* 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 _RADIOLOGGER_H_
+#define _RADIOLOGGER_H_
+
+// System includes
+#include <QObject>
+
+// User includes
+
+#ifdef BUILD_WRAPPER_DLL
+    #define WRAPPER_DLL_EXPORT Q_DECL_EXPORT
+#else
+    #define WRAPPER_DLL_EXPORT Q_DECL_IMPORT
+#endif
+
+class WRAPPER_DLL_EXPORT RadioLogger
+{
+public:
+
+    enum Mode { Normal, MethodEnter, MethodExit, DecIndent };
+
+    static void initCombinedLogger();
+    static void releaseCombinedLogger();
+
+    static void logMsg( const char* msg, Mode mode = Normal );
+
+private:
+    RadioLogger();
+    ~RadioLogger();
+};
+
+// ============================================================================
+// START TIMESTAMP LOGGING
+// ============================================================================
+
+#ifdef TIMESTAMP_LOGGING_ENABLED
+
+#include <QTime>
+#include <QDebug>
+
+/**
+ * Timestamp logging macro.
+ * When the macro is defined, timestamp logging is on
+ *
+ * Example. These lines in the code...
+ *  LOG_TIMESTAMP( "Start operation" );
+ *  ...
+ *  LOG_TIMESTAMP( "End operation" );
+ *
+ * ... print the following log lines
+ *  FMRadio: Start operation "14:13:09.042"
+ *  FMRadio: End operation "14:13:09.250"
+ */
+//#define LOG_TIMESTAMP(comment) do{ qDebug() << LOGMARKER << comment << QTime::currentTime().toString("hh:mm:ss.zzz"); }while(0)
+#define LOG_TIMESTAMP(comment) LOG_FORMAT( comment ## " %s", GETSTRING( QTime::currentTime().toString("hh:mm:ss.zzz") ) )
+
+#else
+
+#define LOG_TIMESTAMP(comment)
+
+#endif // TIMESTAMP_LOGGING_ENABLED
+
+// ============================================================================
+// END TIMESTAMP LOGGING
+// ============================================================================
+
+// ============================================================================
+// START FULL LOGGING
+// ============================================================================
+
+#ifdef LOGGING_ENABLED
+
+#include <QtGlobal>
+#include <QDebug>
+
+// Log marker that is printed in the beginnig of each line
+#define LOGMARKER "FMRadio:"
+
+// UI logs can be combined with engine logs by making the UI feed its log prints into
+// the engine logger. This requires that we initialize the radio engine utils right here
+// because the engine won't start up until much later. This is a bit ugly since the macros
+// call Symbian code directly, but it was considered to be worth it to see UI and engine
+// traces in the same file.
+#if defined COMBINE_WITH_ENGINE_LOGGER && defined LOGGING_ENABLED && !defined BUILD_WIN32
+#   include "../../../radioengine/utils/api/mradioenginelogger.h"
+#   include "../../../radioengine/utils/api/radioengineutils.h"
+#   define WRITELOG(msg) RadioLogger::logMsg( msg );
+#   define WRITELOG_METHOD_ENTER(msg) RadioLogger::logMsg( GETSTRING( msg ), RadioLogger::MethodEnter );
+#   define WRITELOG_METHOD_EXIT(msg) RadioLogger::logMsg( GETSTRING( msg ), RadioLogger::MethodExit );
+#   define LOGGER_DEC_INDENT RadioLogger::logMsg( "", RadioLogger::DecIndent );
+#   define WRITELOG_GETSTRING(msg) WRITELOG( GETSTRING( msg ) )
+#   define INIT_COMBINED_LOGGER RadioLogger::initCombinedLogger();
+#   define RELEASE_COMBINED_LOGGER RadioLogger::releaseCombinedLogger();
+#else
+#   define WRITELOG(msg) qDebug() << LOGMARKER << msg;
+#   define WRITELOG_METHOD_ENTER(msg) WRITELOG(msg)
+#   define WRITELOG_METHOD_EXIT(msg) WRITELOG(msg)
+#   define WRITELOG_GETSTRING(msg) WRITELOG(msg)
+#   define LOGGER_INC_INDENT
+#   define LOGGER_DEC_INDENT
+#   define INIT_COMBINED_LOGGER
+#   define RELEASE_COMBINED_LOGGER
+#endif
+
+// Macro that simply logs a string
+// Example:
+// LOG( "This is a test" );
+#define LOG(string) do{ WRITELOG( string ) }while(0)
+
+// Helper macro to get a const char* out of a QString so that it can be logged. Can be used with LOG_FORMAT()
+#define GETSTRING(qstring) qstring.toAscii().constData()
+
+// Macro that logs a string with multiple parameters
+// Examples:
+// LOG_FORMAT( "This is an integer %d, and this is a float with two digits %.2f", 42, 3.14 );
+// LOG_FORMAT( "This is a QString %s", GETSTRING(someQString) );
+#define LOG_FORMAT(fmt,args...) do{ QString tmp; WRITELOG_GETSTRING( tmp.sprintf(fmt,args) ) }while(0)
+
+// Macro that logs function enter, exit and exception
+// Example (Simply put it in the beginning of a function):
+// LOG_METHOD;
+// Output:
+// -> SomeFunction(int,const char*)
+// <- SomeFunction(int,const char*)
+// <- SomeFunction(int,const char*): Exception raised!
+#define LOG_METHOD MethodLogger ___methodLogger( __PRETTY_FUNCTION__, "" )
+
+// Same as the previous function logging macro with the addition of logging the return value
+// Note! The return value can only be retrieved in the emulator.
+// Example (Simply put it in the beginning of a function):
+// LOG_METHOD_RET( "%d" );
+// Output:
+// -> SomeFunction(int,const char*)
+// <- SomeFunction(int,const char*) returning 42
+#define LOG_METHOD_RET(fmt) MethodLogger ___methodLogger( __PRETTY_FUNCTION__, fmt )
+
+// Logs function enter but does not log exit or leave. This is meant to be lighter than LOG_METHOD macro
+#define LOG_METHOD_ENTER LOG_FORMAT( "Enter: %s", __PRETTY_FUNCTION__ )
+
+// Assert macro for logging. If the condition is false, the expression is performed
+// Example:
+// LOG_ASSERT( thisMustBeTrue, LOG_FORMAT( "OMG! That was not true: %d", thisMustBeTrue ) );
+#define LOG_ASSERT(cond,expr) do{ if (!cond) { expr; } }while(0)
+
+// Macro to hide a function variable that is used only when debugging is enabled.
+// Expands to the variable name when debugging is enabled and to nothing when it is not
+#define DEBUGVAR(a) a
+
+// Macro to log slot function caller by its class name.
+#define LOG_SLOT_CALLER do { \
+        QObject* caller = sender(); \
+        if ( caller ) { \
+            LOG_FORMAT( "SLOT %s called by %s. Objectname: %s", __PRETTY_FUNCTION__, \
+                caller->metaObject()->className(), GETSTRING( caller->objectName() ) ); \
+        } else { \
+            LOG_FORMAT( "SLOT %s called as regular function. ", __PRETTY_FUNCTION__ ); \
+        } \
+    } while (0)
+
+// Class declaration
+class WRAPPER_DLL_EXPORT MethodLogger
+{
+public:
+
+    MethodLogger( const char* function, const char* format );
+    ~MethodLogger();
+
+private:
+
+    const char* mFunction;
+    const char* mFormat;
+
+};
+
+#else // LOGGING_ENABLED
+
+#   define LOG(string)
+#   define GETSTRING(qstring)
+#   define LOG_FORMAT(fmt,args...)
+#   define LOG_METHOD
+#   define LOG_METHOD_RET(fmt)
+#   define LOG_METHOD_ENTER
+#   define LOG_ASSERT(cond,expr)
+#   define DEBUGVAR(a)
+#   define LOG_SLOT_CALLER
+#   define INIT_COMBINED_LOGGER
+#   define RELEASE_COMBINED_LOGGER
+
+
+// Dummy class
+class WRAPPER_DLL_EXPORT MethodLogger
+{
+public:
+    MethodLogger( const char*, const char* );
+    ~MethodLogger();
+};
+
+#endif // LOGGING_ENABLED
+
+#ifdef TRACE_TO_FILE
+
+#   define INSTALL_MESSAGE_HANDLER FileLogger::installMessageHandler(QString(TRACE_OUTPUT_FILE), FILTER_BY_LOGMARKER);
+#   define UNINSTALL_MESSAGE_HANDLER FileLogger::uninstallMessageHandler();
+
+// Class declaration
+class WRAPPER_DLL_EXPORT FileLogger
+{
+public:
+
+    static void installMessageHandler( const QString& fileName, bool filterByMarker = true );
+    static void uninstallMessageHandler();
+
+private:
+
+    static void handleMessage( QtMsgType type, const char* msg );
+
+};
+
+#else
+#   define INSTALL_MESSAGE_HANDLER
+#   define UNINSTALL_MESSAGE_HANDLER
+#endif // TRACE_TO_FILE
+
+// ============================================================================
+// END FULL LOGGING
+// ============================================================================
+
+// ============================================================================
+// SIGNAL/SLOT CONNECTION CHECKER
+// ============================================================================
+static bool connectAndTest( const QObject* sender, const char* signal,
+                            const QObject* receiver, const char* member,
+                            Qt::ConnectionType type = Qt::AutoConnection )
+{
+    bool connected = QObject::connect( sender, signal, receiver, member, type );
+
+#   ifdef CONNECT_TEST_MODE
+
+    if ( !connected )
+    {
+        LOG( "Failed to make a signal-slot connection!" );
+        LOG_FORMAT( "sender: %s", sender->metaObject()->className() );
+        LOG_FORMAT( "signal: %s", signal );
+        LOG_FORMAT( "receiver: %s", receiver->metaObject()->className() );
+        LOG_FORMAT( "slot/signal: %s", signal );
+
+        #if CONNECT_TEST_MODE == 2
+            Q_ASSERT( false );
+        #endif
+
+        // ----------------------------------------------------------------
+        // SIGNAL-SLOT CONNECTION FAILED!
+        // ----------------------------------------------------------------
+    }
+
+#   endif
+
+    return connected;
+}
+
+#ifdef ENABLE_ASSERTS
+
+    #define RADIO_ASSERT(cond,where,what) Q_ASSERT_X(cond,where,what)
+
+#else
+#   ifdef LOGGING_ENABLED
+#       define RADIO_ASSERT(cond,where,what) \
+            do { \
+                if ( !cond ) { \
+                    LOG_FORMAT( "ASSERT Failed! %s, %s", where, what ); \
+                } \
+            } while ( false )
+#   else
+#       define RADIO_ASSERT(cond,where,what)
+#   endif // LOGGING_ENABLED
+#endif // ENABLE_ASSERTS
+
+#endif // _RADIOLOGGER_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/commoninc/radionotificationdata.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef RADIONOTIFICATIONDATA_H
+#define RADIONOTIFICATIONDATA_H
+
+class RadioNotificationData
+{
+public:
+
+    RadioNotificationData() : mType( 0 ) {}
+    RadioNotificationData( int type, const QVariant& data ) :
+        mType( type ),
+        mData( data )
+    {}
+
+    virtual ~RadioNotificationData() {}
+
+    template <typename Stream> void serialize( Stream& stream ) const;
+    template <typename Stream> void deserialize( Stream& stream );
+
+    int         mType;
+    QVariant    mData;
+
+};
+
+Q_DECLARE_USER_METATYPE(RadioNotificationData)
+
+template <typename Stream> void RadioNotificationData::serialize( Stream& stream ) const
+{
+    stream << mType;
+    stream << mData;
+}
+
+template <typename Stream> void RadioNotificationData::deserialize( Stream& stream )
+{
+    stream >> mType;
+    stream >> mData;
+}
+
+Q_IMPLEMENT_USER_METATYPE(RadioNotificationData)
+
+#endif // RADIONOTIFICATIONDATA_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/commoninc/radioservicedef.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,67 @@
+/*
+* 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 RADIOSERVICES_H
+#define RADIOSERVICES_H
+
+static QString RADIO_CONTROL_SERVICE = "com.nokia.services.Radio.IRadioControl";
+static QString RADIO_MONITOR_SERVICE = "com.nokia.services.Radio.IRadioMonitor";
+
+const long KRadioPSUid = 0x101FF976;
+const unsigned long KRadioStartupKey = 0x00000014;
+
+namespace RadioServiceCommand
+{
+    enum CommandId
+    {
+        Play,
+        Pause,
+        Previous,
+        Next,
+        SeekUp,
+        SeekDown,
+        Foreground,
+        Background
+    };
+}
+
+namespace RadioServiceNotification
+{
+    enum Type {
+        FavoriteCount = 1,
+        RadioStatus,
+        Frequency,
+        Name,
+        Genre,
+        RadioText,
+        HomePage,
+        Song
+    };
+}
+
+namespace RadioStatus
+{
+    enum Status {
+        UnSpecified,
+        Playing,
+        Muted,
+        Seeking,
+        NoAntenna
+    };
+}
+
+#endif // RADIOSERVICES_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/eabi/radioenginewrapperu.def	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,45 @@
+EXPORTS
+	_ZN11RadioLogger18initCombinedLoggerEv @ 1 NONAME
+	_ZN11RadioLogger21releaseCombinedLoggerEv @ 2 NONAME
+	_ZN11RadioLogger6logMsgEPKcNS_4ModeE @ 3 NONAME
+	_ZN12MethodLoggerC1EPKcS1_ @ 4 NONAME
+	_ZN12MethodLoggerC2EPKcS1_ @ 5 NONAME
+	_ZN12MethodLoggerD1Ev @ 6 NONAME
+	_ZN12MethodLoggerD2Ev @ 7 NONAME
+	_ZN18RadioEngineWrapper11addObserverEP26RadioEngineWrapperObserver @ 8 NONAME
+	_ZN18RadioEngineWrapper12startSeekingEN7Seeking9DirectionEi @ 9 NONAME
+	_ZN18RadioEngineWrapper13cancelSeekingEv @ 10 NONAME
+	_ZN18RadioEngineWrapper13tuneFrequencyEji @ 11 NONAME
+	_ZN18RadioEngineWrapper13tuneWithDelayEji @ 12 NONAME
+	_ZN18RadioEngineWrapper14removeObserverEP26RadioEngineWrapperObserver @ 13 NONAME
+	_ZN18RadioEngineWrapper16isFrequencyValidEj @ 14 NONAME
+	_ZN18RadioEngineWrapper16toggleAudioRouteEv @ 15 NONAME
+	_ZN18RadioEngineWrapper19isEngineConstructedEv @ 16 NONAME
+	_ZN18RadioEngineWrapper7setMuteEb @ 17 NONAME
+	_ZN18RadioEngineWrapper8settingsEv @ 18 NONAME
+	_ZN18RadioEngineWrapper9setVolumeEi @ 19 NONAME
+	_ZN18RadioEngineWrapperC1ER21RadioStationHandlerIf @ 20 NONAME
+	_ZN18RadioEngineWrapperC2ER21RadioStationHandlerIf @ 21 NONAME
+	_ZN18RadioEngineWrapperD1Ev @ 22 NONAME
+	_ZN18RadioEngineWrapperD2Ev @ 23 NONAME
+	_ZN26RadioEngineWrapperObserver11muteChangedEb @ 24 NONAME
+	_ZN26RadioEngineWrapperObserver12skipPreviousEv @ 25 NONAME
+	_ZN26RadioEngineWrapperObserver13volumeChangedEi @ 26 NONAME
+	_ZN26RadioEngineWrapperObserver16tunedToFrequencyEji @ 27 NONAME
+	_ZN26RadioEngineWrapperObserver17audioRouteChangedEb @ 28 NONAME
+	_ZN26RadioEngineWrapperObserver18radioStatusChangedEb @ 29 NONAME
+	_ZN26RadioEngineWrapperObserver20antennaStatusChangedEb @ 30 NONAME
+	_ZN26RadioEngineWrapperObserver22rdsAvailabilityChangedEb @ 31 NONAME
+	_ZN26RadioEngineWrapperObserver8skipNextEv @ 32 NONAME
+	_ZNK18RadioEngineWrapper12maxFrequencyEv @ 33 NONAME
+	_ZNK18RadioEngineWrapper12minFrequencyEv @ 34 NONAME
+	_ZNK18RadioEngineWrapper16currentFrequencyEv @ 35 NONAME
+	_ZNK18RadioEngineWrapper17frequencyStepSizeEv @ 36 NONAME
+	_ZNK18RadioEngineWrapper17isAntennaAttachedEv @ 37 NONAME
+	_ZNK18RadioEngineWrapper18isUsingLoudspeakerEv @ 38 NONAME
+	_ZNK18RadioEngineWrapper6regionEv @ 39 NONAME
+	_ZNK18RadioEngineWrapper7isMutedEv @ 40 NONAME
+	_ZNK18RadioEngineWrapper9isRadioOnEv @ 41 NONAME
+	_ZTI26RadioEngineWrapperObserver @ 42 NONAME
+	_ZTV26RadioEngineWrapperObserver @ 43 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/eabi/radiopresetstorageu.def	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,13 @@
+EXPORTS
+	_ZN18RadioPresetStorage10readPresetEiR14RadioStationIf @ 1 NONAME
+	_ZN18RadioPresetStorage10savePresetERK14RadioStationIf @ 2 NONAME
+	_ZN18RadioPresetStorage12deletePresetEi @ 3 NONAME
+	_ZN18RadioPresetStorageC1Ev @ 4 NONAME
+	_ZN18RadioPresetStorageC2Ev @ 5 NONAME
+	_ZN18RadioPresetStorageD1Ev @ 6 NONAME
+	_ZN18RadioPresetStorageD2Ev @ 7 NONAME
+	_ZNK18RadioPresetStorage10nextPresetEi @ 8 NONAME
+	_ZNK18RadioPresetStorage11firstPresetEv @ 9 NONAME
+	_ZNK18RadioPresetStorage11presetCountEv @ 10 NONAME
+	_ZNK18RadioPresetStorage18maxNumberOfPresetsEv @ 11 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/eabi/radiouiengineu.def	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,283 @@
+EXPORTS
+	_ZN12RadioStation11setFavoriteEb @ 1 NONAME
+	_ZN12RadioStation12callSignCharEj @ 2 NONAME
+	_ZN12RadioStation12setFrequencyEj @ 3 NONAME
+	_ZN12RadioStation12setRadioTextERK7QString @ 4 NONAME
+	_ZN12RadioStation14callSignStringEj @ 5 NONAME
+	_ZN12RadioStation14parseFrequencyEj @ 6 NONAME
+	_ZN12RadioStation14setChangeFlagsE6QFlagsINS_10ChangeFlagEE @ 7 NONAME
+	_ZN12RadioStation14setPresetIndexEi @ 8 NONAME
+	_ZN12RadioStation15iterateCallSignEii @ 9 NONAME
+	_ZN12RadioStation16piCodeToCallSignEj @ 10 NONAME
+	_ZN12RadioStation16resetChangeFlagsEv @ 11 NONAME
+	_ZN12RadioStation16setDynamicPsTextERK7QString @ 12 NONAME
+	_ZN12RadioStation16setRadioTextPlusEiRK7QString @ 13 NONAME
+	_ZN12RadioStation18setUserDefinedNameERK7QString @ 14 NONAME
+	_ZN12RadioStation23decrementReferenceCountEv @ 15 NONAME
+	_ZN12RadioStation5resetEv @ 16 NONAME
+	_ZN12RadioStation6detachEv @ 17 NONAME
+	_ZN12RadioStation6setUrlERK7QString @ 18 NONAME
+	_ZN12RadioStation7setNameERK7QString @ 19 NONAME
+	_ZN12RadioStation7setTypeE6QFlagsINS_8TypeFlagEE @ 20 NONAME
+	_ZN12RadioStation8setGenreEi @ 21 NONAME
+	_ZN12RadioStation9setPiCodeEiN11RadioRegion6RegionE @ 22 NONAME
+	_ZN12RadioStation9setPsTypeE6QFlagsINS_10PsTypeFlagEE @ 23 NONAME
+	_ZN12RadioStation9unsetTypeE6QFlagsINS_8TypeFlagEE @ 24 NONAME
+	_ZN12RadioStationC1ERKS_ @ 25 NONAME
+	_ZN12RadioStationC1Eij @ 26 NONAME
+	_ZN12RadioStationC1Ev @ 27 NONAME
+	_ZN12RadioStationC2ERKS_ @ 28 NONAME
+	_ZN12RadioStationC2Eij @ 29 NONAME
+	_ZN12RadioStationC2Ev @ 30 NONAME
+	_ZN12RadioStationD0Ev @ 31 NONAME
+	_ZN12RadioStationD1Ev @ 32 NONAME
+	_ZN12RadioStationD2Ev @ 33 NONAME
+	_ZN12RadioStationaSERKS_ @ 34 NONAME
+	_ZN13RadioUiEngine10toggleMuteEv @ 35 NONAME
+	_ZN13RadioUiEngine10tunePresetEi @ 36 NONAME
+	_ZN13RadioUiEngine11muteChangedEb @ 37 NONAME
+	_ZN13RadioUiEngine11qt_metacallEN11QMetaObject4CallEiPPv @ 38 NONAME
+	_ZN13RadioUiEngine11qt_metacastEPKc @ 39 NONAME
+	_ZN13RadioUiEngine11seekStationEi @ 40 NONAME
+	_ZN13RadioUiEngine11skipStationEN11StationSkip4ModeEj @ 41 NONAME
+	_ZN13RadioUiEngine12historyModelEv @ 42 NONAME
+	_ZN13RadioUiEngine12stationModelEv @ 43 NONAME
+	_ZN13RadioUiEngine13carouselModelEv @ 44 NONAME
+	_ZN13RadioUiEngine13genreToStringEiN11GenreTarget6TargetE @ 45 NONAME
+	_ZN13RadioUiEngine13scannerEngineEv @ 46 NONAME
+	_ZN13RadioUiEngine13tuneFrequencyEji @ 47 NONAME
+	_ZN13RadioUiEngine13tuneWithDelayEji @ 48 NONAME
+	_ZN13RadioUiEngine13volumeChangedEi @ 49 NONAME
+	_ZN13RadioUiEngine14seekingStartedEi @ 50 NONAME
+	_ZN13RadioUiEngine15emitMuteChangedEb @ 51 NONAME
+	_ZN13RadioUiEngine15stationsInRangeEjj @ 52 NONAME
+	_ZN13RadioUiEngine16isFirstTimeStartEv @ 53 NONAME
+	_ZN13RadioUiEngine16isOfflineProfileEv @ 54 NONAME
+	_ZN13RadioUiEngine16staticMetaObjectE @ 55 NONAME DATA 16
+	_ZN13RadioUiEngine16toggleAudioRouteEv @ 56 NONAME
+	_ZN13RadioUiEngine16tunedToFrequencyEji @ 57 NONAME
+	_ZN13RadioUiEngine17addRecognizedSongERK7QStringS2_RK12RadioStation @ 58 NONAME
+	_ZN13RadioUiEngine17audioRouteChangedEb @ 59 NONAME
+	_ZN13RadioUiEngine17emitVolumeChangedEi @ 60 NONAME
+	_ZN13RadioUiEngine18emitSeekingStartedEN7Seeking9DirectionE @ 61 NONAME
+	_ZN13RadioUiEngine18lastTunedFrequencyEv @ 62 NONAME
+	_ZN13RadioUiEngine18radioStatusChangedEb @ 63 NONAME
+	_ZN13RadioUiEngine19getStaticMetaObjectEv @ 64 NONAME
+	_ZN13RadioUiEngine20antennaStatusChangedEb @ 65 NONAME
+	_ZN13RadioUiEngine20createNewFilterModelEP7QObject @ 66 NONAME
+	_ZN13RadioUiEngine20emitTunedToFrequencyEji @ 67 NONAME
+	_ZN13RadioUiEngine21emitAudioRouteChangedEb @ 68 NONAME
+	_ZN13RadioUiEngine21launchSongRecognitionEv @ 69 NONAME
+	_ZN13RadioUiEngine22emitRadioStatusChangedEb @ 70 NONAME
+	_ZN13RadioUiEngine22rdsAvailabilityChangedEb @ 71 NONAME
+	_ZN13RadioUiEngine24emitAntennaStatusChangedEb @ 72 NONAME
+	_ZN13RadioUiEngine26emitRdsAvailabilityChangedEb @ 73 NONAME
+	_ZN13RadioUiEngine29isSongRecognitionAppAvailableEv @ 74 NONAME
+	_ZN13RadioUiEngine4initEv @ 75 NONAME
+	_ZN13RadioUiEngine7setMuteEb @ 76 NONAME
+	_ZN13RadioUiEngine8settingsEv @ 77 NONAME
+	_ZN13RadioUiEngine9setVolumeEi @ 78 NONAME
+	_ZN13RadioUiEngineC1EP7QObject @ 79 NONAME
+	_ZN13RadioUiEngineC2EP7QObject @ 80 NONAME
+	_ZN13RadioUiEngineD0Ev @ 81 NONAME
+	_ZN13RadioUiEngineD1Ev @ 82 NONAME
+	_ZN13RadioUiEngineD2Ev @ 83 NONAME
+	_ZN16RadioHistoryItem10setStationERK7QString @ 84 NONAME
+	_ZN16RadioHistoryItem12setFrequencyEj @ 85 NONAME
+	_ZN16RadioHistoryItem14setCurrentTimeEv @ 86 NONAME
+	_ZN16RadioHistoryItem23decrementReferenceCountEv @ 87 NONAME
+	_ZN16RadioHistoryItem5resetEv @ 88 NONAME
+	_ZN16RadioHistoryItem6detachEv @ 89 NONAME
+	_ZN16RadioHistoryItem8setTitleERK7QString @ 90 NONAME
+	_ZN16RadioHistoryItem9setArtistERK7QString @ 91 NONAME
+	_ZN16RadioHistoryItemC1ERK7QStringS2_ @ 92 NONAME
+	_ZN16RadioHistoryItemC1ERKS_ @ 93 NONAME
+	_ZN16RadioHistoryItemC1Ev @ 94 NONAME
+	_ZN16RadioHistoryItemC2ERK7QStringS2_ @ 95 NONAME
+	_ZN16RadioHistoryItemC2ERKS_ @ 96 NONAME
+	_ZN16RadioHistoryItemC2Ev @ 97 NONAME
+	_ZN16RadioHistoryItemD0Ev @ 98 NONAME
+	_ZN16RadioHistoryItemD1Ev @ 99 NONAME
+	_ZN16RadioHistoryItemD2Ev @ 100 NONAME
+	_ZN16RadioHistoryItemaSERKS_ @ 101 NONAME
+	_ZN17RadioHistoryModel11qt_metacallEN11QMetaObject4CallEiPPv @ 102 NONAME
+	_ZN17RadioHistoryModel11qt_metacastEPKc @ 103 NONAME
+	_ZN17RadioHistoryModel13emitItemAddedEv @ 104 NONAME
+	_ZN17RadioHistoryModel13setShowTaggedEb @ 105 NONAME
+	_ZN17RadioHistoryModel13toggleTaggingERK16RadioHistoryItemi @ 106 NONAME
+	_ZN17RadioHistoryModel14setShowDetailsEb @ 107 NONAME
+	_ZN17RadioHistoryModel16addRadioTextPlusEiRK7QStringRK12RadioStation @ 108 NONAME
+	_ZN17RadioHistoryModel16currentSongResetEv @ 109 NONAME
+	_ZN17RadioHistoryModel16resetCurrentSongEv @ 110 NONAME
+	_ZN17RadioHistoryModel16staticMetaObjectE @ 111 NONAME DATA 16
+	_ZN17RadioHistoryModel17reportChangedDataEii @ 112 NONAME
+	_ZN17RadioHistoryModel18clearRadioTextPlusEv @ 113 NONAME
+	_ZN17RadioHistoryModel19getStaticMetaObjectEv @ 114 NONAME
+	_ZN17RadioHistoryModel7addItemERK7QStringS2_RK12RadioStation @ 115 NONAME
+	_ZN17RadioHistoryModel8setIconsERK5QIconS2_ @ 116 NONAME
+	_ZN17RadioHistoryModel9itemAddedEv @ 117 NONAME
+	_ZN17RadioHistoryModel9removeAllEv @ 118 NONAME
+	_ZN17RadioHistoryModelC1ER13RadioUiEngine @ 119 NONAME
+	_ZN17RadioHistoryModelC2ER13RadioUiEngine @ 120 NONAME
+	_ZN17RadioHistoryModelD0Ev @ 121 NONAME
+	_ZN17RadioHistoryModelD1Ev @ 122 NONAME
+	_ZN17RadioHistoryModelD2Ev @ 123 NONAME
+	_ZN17RadioStationModel10addStationERK12RadioStation @ 124 NONAME
+	_ZN17RadioStationModel10initializeEP18RadioPresetStorageP18RadioEngineWrapper @ 125 NONAME
+	_ZN17RadioStationModel11findClosestEjN11StationSkip4ModeE @ 126 NONAME
+	_ZN17RadioStationModel11qt_metacallEN11QMetaObject4CallEiPPv @ 127 NONAME
+	_ZN17RadioStationModel11qt_metacastEPKc @ 128 NONAME
+	_ZN17RadioStationModel11saveStationER12RadioStation @ 129 NONAME
+	_ZN17RadioStationModel12setFavoritesERK5QListI11QModelIndexE @ 130 NONAME
+	_ZN17RadioStationModel13favoriteCountEv @ 131 NONAME
+	_ZN17RadioStationModel13findFrequencyEjR12RadioStation @ 132 NONAME
+	_ZN17RadioStationModel13removeStationERK12RadioStation @ 133 NONAME
+	_ZN17RadioStationModel13renameStationEiRK7QString @ 134 NONAME
+	_ZN17RadioStationModel14currentStationEv @ 135 NONAME
+	_ZN17RadioStationModel15emitDataChangedERK12RadioStation @ 136 NONAME
+	_ZN17RadioStationModel15favoriteChangedERK12RadioStation @ 137 NONAME
+	_ZN17RadioStationModel15findPresetIndexEi @ 138 NONAME
+	_ZN17RadioStationModel15findPresetIndexEiR12RadioStation @ 139 NONAME
+	_ZN17RadioStationModel15stationsInRangeEjj @ 140 NONAME
+	_ZN17RadioStationModel16dynamicPsChangedERK12RadioStation @ 141 NONAME
+	_ZN17RadioStationModel16staticMetaObjectE @ 142 NONAME DATA 16
+	_ZN17RadioStationModel16stationHandlerIfEv @ 143 NONAME
+	_ZN17RadioStationModel17emitChangeSignalsERK12RadioStation6QFlagsINS0_10ChangeFlagEE @ 144 NONAME
+	_ZN17RadioStationModel17radioTextReceivedERK12RadioStation @ 145 NONAME
+	_ZN17RadioStationModel17removeByFrequencyEj @ 146 NONAME
+	_ZN17RadioStationModel18findCurrentStationEj @ 147 NONAME
+	_ZN17RadioStationModel18stationDataChangedERK12RadioStation @ 148 NONAME
+	_ZN17RadioStationModel19dynamicPsCheckEndedEv @ 149 NONAME
+	_ZN17RadioStationModel19getStaticMetaObjectEv @ 150 NONAME
+	_ZN17RadioStationModel19removeByPresetIndexEi @ 151 NONAME
+	_ZN17RadioStationModel19setFavoriteByPresetEib @ 152 NONAME
+	_ZN17RadioStationModel21findUnusedPresetIndexEv @ 153 NONAME
+	_ZN17RadioStationModel22setFavoriteByFrequencyEjb @ 154 NONAME
+	_ZN17RadioStationModel23modelIndexFromFrequencyEj @ 155 NONAME
+	_ZN17RadioStationModel7setDataERK11QModelIndexRK8QVarianti @ 156 NONAME
+	_ZN17RadioStationModel8setIconsERK5QIconS2_ @ 157 NONAME
+	_ZN17RadioStationModel9removeAllENS_10RemoveModeE @ 158 NONAME
+	_ZN17RadioStationModel9setDetailE6QFlagsINS_10DetailFlagEE @ 159 NONAME
+	_ZN17RadioStationModelC1ER20RadioUiEnginePrivate @ 160 NONAME
+	_ZN17RadioStationModelC2ER20RadioUiEnginePrivate @ 161 NONAME
+	_ZN17RadioStationModelD0Ev @ 162 NONAME
+	_ZN17RadioStationModelD1Ev @ 163 NONAME
+	_ZN17RadioStationModelD2Ev @ 164 NONAME
+	_ZN18RadioCarouselModel11findClosestEjN11StationSkip4ModeE @ 165 NONAME
+	_ZN18RadioCarouselModel11qt_metacallEN11QMetaObject4CallEiPPv @ 166 NONAME
+	_ZN18RadioCarouselModel11qt_metacastEPKc @ 167 NONAME
+	_ZN18RadioCarouselModel15removeFrequencyERK11QModelIndexii @ 168 NONAME
+	_ZN18RadioCarouselModel16staticMetaObjectE @ 169 NONAME DATA 16
+	_ZN18RadioCarouselModel19getStaticMetaObjectEv @ 170 NONAME
+	_ZN18RadioCarouselModel23modelIndexFromFrequencyEj @ 171 NONAME
+	_ZN18RadioCarouselModelC1ER13RadioUiEngineR17RadioStationModel @ 172 NONAME
+	_ZN18RadioCarouselModelC2ER13RadioUiEngineR17RadioStationModel @ 173 NONAME
+	_ZN18RadioCarouselModelD0Ev @ 174 NONAME
+	_ZN18RadioCarouselModelD1Ev @ 175 NONAME
+	_ZN18RadioCarouselModelD2Ev @ 176 NONAME
+	_ZN18RadioScannerEngine11qt_metacallEN11QMetaObject4CallEiPPv @ 177 NONAME
+	_ZN18RadioScannerEngine11qt_metacastEPKc @ 178 NONAME
+	_ZN18RadioScannerEngine12stationFoundERK12RadioStation @ 179 NONAME
+	_ZN18RadioScannerEngine13startScanningEv @ 180 NONAME
+	_ZN18RadioScannerEngine16continueScanningEv @ 181 NONAME
+	_ZN18RadioScannerEngine16emitStationFoundERK12RadioStation @ 182 NONAME
+	_ZN18RadioScannerEngine16staticMetaObjectE @ 183 NONAME DATA 16
+	_ZN18RadioScannerEngine19addScannedFrequencyEj @ 184 NONAME
+	_ZN18RadioScannerEngine19getStaticMetaObjectEv @ 185 NONAME
+	_ZN18RadioScannerEngine6cancelEv @ 186 NONAME
+	_ZN18RadioScannerEngineC1ER20RadioUiEnginePrivate @ 187 NONAME
+	_ZN18RadioScannerEngineC2ER20RadioUiEnginePrivate @ 188 NONAME
+	_ZN18RadioScannerEngineD0Ev @ 189 NONAME
+	_ZN18RadioScannerEngineD1Ev @ 190 NONAME
+	_ZN18RadioScannerEngineD2Ev @ 191 NONAME
+	_ZN23RadioStationFilterModel13setTypeFilterE6QFlagsIN12RadioStation8TypeFlagEE @ 192 NONAME
+	_ZN23RadioStationFilterModel23modelIndexFromFrequencyEj @ 193 NONAME
+	_ZN23RadioStationFilterModel9setCyclicEb @ 194 NONAME
+	_ZN23RadioStationFilterModelC1ER13RadioUiEngineP7QObject @ 195 NONAME
+	_ZN23RadioStationFilterModelC2ER13RadioUiEngineP7QObject @ 196 NONAME
+	_ZN23RadioStationFilterModelD0Ev @ 197 NONAME
+	_ZN23RadioStationFilterModelD1Ev @ 198 NONAME
+	_ZN23RadioStationFilterModelD2Ev @ 199 NONAME
+	_ZNK12RadioStation10hasChangedEv @ 200 NONAME
+	_ZNK12RadioStation10isDetachedEv @ 201 NONAME
+	_ZNK12RadioStation10isFavoriteEv @ 202 NONAME
+	_ZNK12RadioStation11changeFlagsEv @ 203 NONAME
+	_ZNK12RadioStation11presetIndexEv @ 204 NONAME
+	_ZNK12RadioStation12frequencyMhzEv @ 205 NONAME
+	_ZNK12RadioStation13dynamicPsTextEv @ 206 NONAME
+	_ZNK12RadioStation14hasDataChangedE6QFlagsINS_10ChangeFlagEE @ 207 NONAME
+	_ZNK12RadioStation3urlEv @ 208 NONAME
+	_ZNK12RadioStation4nameEv @ 209 NONAME
+	_ZNK12RadioStation5genreEv @ 210 NONAME
+	_ZNK12RadioStation6hasRdsEv @ 211 NONAME
+	_ZNK12RadioStation6isTypeE6QFlagsINS_8TypeFlagEE @ 212 NONAME
+	_ZNK12RadioStation6psTypeEv @ 213 NONAME
+	_ZNK12RadioStation7isValidEv @ 214 NONAME
+	_ZNK12RadioStation9frequencyEv @ 215 NONAME
+	_ZNK12RadioStation9hasPiCodeEv @ 216 NONAME
+	_ZNK12RadioStation9isRenamedEv @ 217 NONAME
+	_ZNK12RadioStation9radioTextEv @ 218 NONAME
+	_ZNK13RadioUiEngine10isScanningEv @ 219 NONAME
+	_ZNK13RadioUiEngine10metaObjectEv @ 220 NONAME
+	_ZNK13RadioUiEngine12maxFrequencyEv @ 221 NONAME
+	_ZNK13RadioUiEngine12minFrequencyEv @ 222 NONAME
+	_ZNK13RadioUiEngine13isInitializedEv @ 223 NONAME
+	_ZNK13RadioUiEngine16currentFrequencyEv @ 224 NONAME
+	_ZNK13RadioUiEngine17frequencyStepSizeEv @ 225 NONAME
+	_ZNK13RadioUiEngine17isAntennaAttachedEv @ 226 NONAME
+	_ZNK13RadioUiEngine18isUsingLoudspeakerEv @ 227 NONAME
+	_ZNK13RadioUiEngine6regionEv @ 228 NONAME
+	_ZNK13RadioUiEngine7isMutedEv @ 229 NONAME
+	_ZNK13RadioUiEngine9isRadioOnEv @ 230 NONAME
+	_ZNK16RadioHistoryItem10isDetachedEv @ 231 NONAME
+	_ZNK16RadioHistoryItem17isRecognizedByRdsEv @ 232 NONAME
+	_ZNK16RadioHistoryItem2idEv @ 233 NONAME
+	_ZNK16RadioHistoryItem4timeEv @ 234 NONAME
+	_ZNK16RadioHistoryItem5titleEv @ 235 NONAME
+	_ZNK16RadioHistoryItem6artistEv @ 236 NONAME
+	_ZNK16RadioHistoryItem7isValidEv @ 237 NONAME
+	_ZNK16RadioHistoryItem7stationEv @ 238 NONAME
+	_ZNK16RadioHistoryItem8isTaggedEv @ 239 NONAME
+	_ZNK16RadioHistoryItem9frequencyEv @ 240 NONAME
+	_ZNK17RadioHistoryModel10metaObjectEv @ 241 NONAME
+	_ZNK17RadioHistoryModel11itemAtIndexERK11QModelIndex @ 242 NONAME
+	_ZNK17RadioHistoryModel23isCurrentSongRecognizedEv @ 243 NONAME
+	_ZNK17RadioHistoryModel4dataERK11QModelIndexi @ 244 NONAME
+	_ZNK17RadioHistoryModel8rowCountERK11QModelIndex @ 245 NONAME
+	_ZNK17RadioStationModel10metaObjectEv @ 246 NONAME
+	_ZNK17RadioStationModel14currentStationEv @ 247 NONAME
+	_ZNK17RadioStationModel4dataERK11QModelIndexi @ 248 NONAME
+	_ZNK17RadioStationModel4listEv @ 249 NONAME
+	_ZNK17RadioStationModel5flagsERK11QModelIndex @ 250 NONAME
+	_ZNK17RadioStationModel8rowCountERK11QModelIndex @ 251 NONAME
+	_ZNK17RadioStationModel9stationAtEi @ 252 NONAME
+	_ZNK18RadioCarouselModel10metaObjectEv @ 253 NONAME
+	_ZNK18RadioCarouselModel4dataERK11QModelIndexi @ 254 NONAME
+	_ZNK18RadioCarouselModel8rowCountERK11QModelIndex @ 255 NONAME
+	_ZNK18RadioScannerEngine10isScanningEv @ 256 NONAME
+	_ZNK18RadioScannerEngine10metaObjectEv @ 257 NONAME
+	_ZNK23RadioStationFilterModel16filterAcceptsRowEiRK11QModelIndex @ 258 NONAME
+	_ZNK23RadioStationFilterModel4dataERK11QModelIndexi @ 259 NONAME
+	_ZNK23RadioStationFilterModel5indexEiiRK11QModelIndex @ 260 NONAME
+	_ZNK23RadioStationFilterModel7isEqualERK11QModelIndexS2_ @ 261 NONAME
+	_ZNK23RadioStationFilterModel8rowCountERK11QModelIndex @ 262 NONAME
+	_ZNK23RadioStationFilterModel9hasLoopedERK11QModelIndex @ 263 NONAME
+	_ZNK23RadioStationFilterModel9realIndexERK11QModelIndex @ 264 NONAME
+	_ZTI12RadioStation @ 265 NONAME
+	_ZTI13RadioUiEngine @ 266 NONAME
+	_ZTI16RadioHistoryItem @ 267 NONAME
+	_ZTI17RadioHistoryModel @ 268 NONAME
+	_ZTI17RadioStationModel @ 269 NONAME
+	_ZTI18RadioCarouselModel @ 270 NONAME
+	_ZTI18RadioScannerEngine @ 271 NONAME
+	_ZTI23RadioStationFilterModel @ 272 NONAME
+	_ZTV12RadioStation @ 273 NONAME
+	_ZTV13RadioUiEngine @ 274 NONAME
+	_ZTV16RadioHistoryItem @ 275 NONAME
+	_ZTV17RadioHistoryModel @ 276 NONAME
+	_ZTV17RadioStationModel @ 277 NONAME
+	_ZTV18RadioCarouselModel @ 278 NONAME
+	_ZTV18RadioScannerEngine @ 279 NONAME
+	_ZTV23RadioStationFilterModel @ 280 NONAME
+	_ZN13RadioUiEngine14openMusicStoreERK16RadioHistoryItemNS_10MusicStoreE @ 281 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/eabi/radiowidgetsu.def	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,253 @@
+EXPORTS
+	_ZN11RadioWindow11qt_metacallEN11QMetaObject4CallEiPPv @ 1 NONAME
+	_ZN11RadioWindow11qt_metacastEPKc @ 2 NONAME
+	_ZN11RadioWindow12activateViewER8QPointerI13RadioViewBaseERK7QString6QFlagsIN2Hb14ViewSwitchFlagEE @ 3 NONAME
+	_ZN11RadioWindow15showVolumeLevelEi @ 4 NONAME
+	_ZN11RadioWindow16activateMainViewEv @ 5 NONAME
+	_ZN11RadioWindow16showErrorMessageERK7QString @ 6 NONAME
+	_ZN11RadioWindow16staticMetaObjectE @ 7 NONAME DATA 16
+	_ZN11RadioWindow17updateOrientationEN2Qt11OrientationE @ 8 NONAME
+	_ZN11RadioWindow18orientationSectionEv @ 9 NONAME
+	_ZN11RadioWindow19activateHistoryViewEv @ 10 NONAME
+	_ZN11RadioWindow19getStaticMetaObjectEv @ 11 NONAME
+	_ZN11RadioWindow19updateAntennaStatusEb @ 12 NONAME
+	_ZN11RadioWindow20activateStationsViewEv @ 13 NONAME
+	_ZN11RadioWindow4initEv @ 14 NONAME
+	_ZN11RadioWindow8initViewEv @ 15 NONAME
+	_ZN11RadioWindow8uiEngineEv @ 16 NONAME
+	_ZN11RadioWindowC1EP7QWidget @ 17 NONAME
+	_ZN11RadioWindowC2EP7QWidget @ 18 NONAME
+	_ZN11RadioWindowD0Ev @ 19 NONAME
+	_ZN11RadioWindowD1Ev @ 20 NONAME
+	_ZN11RadioWindowD2Ev @ 21 NONAME
+	_ZN13RadioMainView11qt_metacallEN11QMetaObject4CallEiPPv @ 22 NONAME
+	_ZN13RadioMainView11qt_metacastEPKc @ 23 NONAME
+	_ZN13RadioMainView14seekingStartedEv @ 24 NONAME
+	_ZN13RadioMainView14setOrientationEv @ 25 NONAME
+	_ZN13RadioMainView14toggleScanningEv @ 26 NONAME
+	_ZN13RadioMainView15setScanningModeEb @ 27 NONAME
+	_ZN13RadioMainView16staticMetaObjectE @ 28 NONAME DATA 16
+	_ZN13RadioMainView16updateAudioRouteEb @ 29 NONAME
+	_ZN13RadioMainView19getStaticMetaObjectEv @ 30 NONAME
+	_ZN13RadioMainView22setFrequencyFromEngineEji @ 31 NONAME
+	_ZN13RadioMainView22setFrequencyFromWidgetEji @ 32 NONAME
+	_ZN13RadioMainView4initEv @ 33 NONAME
+	_ZN13RadioMainView4skipEi @ 34 NONAME
+	_ZN13RadioMainViewC1Ev @ 35 NONAME
+	_ZN13RadioMainViewC2Ev @ 36 NONAME
+	_ZN13RadioMainViewD0Ev @ 37 NONAME
+	_ZN13RadioMainViewD1Ev @ 38 NONAME
+	_ZN13RadioMainViewD2Ev @ 39 NONAME
+	_ZN16RadioBannerLabel11qt_metacallEN11QMetaObject4CallEiPPv @ 40 NONAME
+	_ZN16RadioBannerLabel11qt_metacastEPKc @ 41 NONAME
+	_ZN16RadioBannerLabel16staticMetaObjectE @ 42 NONAME DATA 16
+	_ZN16RadioBannerLabel19getStaticMetaObjectEv @ 43 NONAME
+	_ZN16RadioBannerLabel5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget @ 44 NONAME
+	_ZN16RadioBannerLabelC1EP13QGraphicsItem @ 45 NONAME
+	_ZN16RadioBannerLabelC2EP13QGraphicsItem @ 46 NONAME
+	_ZN16RadioFadingLabel11qt_metacallEN11QMetaObject4CallEiPPv @ 47 NONAME
+	_ZN16RadioFadingLabel11qt_metacastEPKc @ 48 NONAME
+	_ZN16RadioFadingLabel11startEffectERK7QStringPKc @ 49 NONAME
+	_ZN16RadioFadingLabel14effectFinishedEN8HbEffect12EffectStatusE @ 50 NONAME
+	_ZN16RadioFadingLabel16setFadingEnabledEb @ 51 NONAME
+	_ZN16RadioFadingLabel16staticMetaObjectE @ 52 NONAME DATA 16
+	_ZN16RadioFadingLabel19getStaticMetaObjectEv @ 53 NONAME
+	_ZN16RadioFadingLabel20setTextWithoutFadingERK7QString @ 54 NONAME
+	_ZN16RadioFadingLabel7setTextERK7QString @ 55 NONAME
+	_ZN16RadioFadingLabel8trimHtmlERK7QString @ 56 NONAME
+	_ZN16RadioFadingLabelC1EP13QGraphicsItem @ 57 NONAME
+	_ZN16RadioFadingLabelC2EP13QGraphicsItem @ 58 NONAME
+	_ZN16RadioHistoryView10addOneSongEv @ 59 NONAME
+	_ZN16RadioHistoryView11qt_metacallEN11QMetaObject4CallEiPPv @ 60 NONAME
+	_ZN16RadioHistoryView11qt_metacastEPKc @ 61 NONAME
+	_ZN16RadioHistoryView12openOviStoreEv @ 62 NONAME
+	_ZN16RadioHistoryView13setTaggedIconERK6HbIcon @ 63 NONAME
+	_ZN16RadioHistoryView13toggleTaggingEv @ 64 NONAME
+	_ZN16RadioHistoryView14openOtherStoreEv @ 65 NONAME
+	_ZN16RadioHistoryView14setOrientationEv @ 66 NONAME
+	_ZN16RadioHistoryView15showContextMenuERK11QModelIndex @ 67 NONAME
+	_ZN16RadioHistoryView16setNonTaggedIconERK6HbIcon @ 68 NONAME
+	_ZN16RadioHistoryView16staticMetaObjectE @ 69 NONAME DATA 16
+	_ZN16RadioHistoryView17deckButtonPressedEv @ 70 NONAME
+	_ZN16RadioHistoryView18updateVisibilitiesEv @ 71 NONAME
+	_ZN16RadioHistoryView19getStaticMetaObjectEv @ 72 NONAME
+	_ZN16RadioHistoryView4initEv @ 73 NONAME
+	_ZN16RadioHistoryView8addSongsEv @ 74 NONAME
+	_ZN16RadioHistoryView9clearListEv @ 75 NONAME
+	_ZN16RadioHistoryViewC1Ev @ 76 NONAME
+	_ZN16RadioHistoryViewC2Ev @ 77 NONAME
+	_ZN16RadioHistoryViewD0Ev @ 78 NONAME
+	_ZN16RadioHistoryViewD1Ev @ 79 NONAME
+	_ZN16RadioHistoryViewD2Ev @ 80 NONAME
+	_ZN17RadioStationsView11qt_metacallEN11QMetaObject4CallEiPPv @ 81 NONAME
+	_ZN17RadioStationsView11qt_metacastEPKc @ 82 NONAME
+	_ZN17RadioStationsView12initListViewEv @ 83 NONAME
+	_ZN17RadioStationsView13deleteStationEv @ 84 NONAME
+	_ZN17RadioStationsView13startScanningEv @ 85 NONAME
+	_ZN17RadioStationsView14finishScanningEv @ 86 NONAME
+	_ZN17RadioStationsView14toggleFavoriteEv @ 87 NONAME
+	_ZN17RadioStationsView15listItemClickedERK11QModelIndex @ 88 NONAME
+	_ZN17RadioStationsView15setFavoriteIconERK6HbIcon @ 89 NONAME
+	_ZN17RadioStationsView16staticMetaObjectE @ 90 NONAME DATA 16
+	_ZN17RadioStationsView17deckButtonPressedEv @ 91 NONAME
+	_ZN17RadioStationsView17setNowPlayingIconERK6HbIcon @ 92 NONAME
+	_ZN17RadioStationsView19getStaticMetaObjectEv @ 93 NONAME
+	_ZN17RadioStationsView19listItemLongPressedEP18HbAbstractViewItemRK7QPointF @ 94 NONAME
+	_ZN17RadioStationsView19updateAntennaStatusEb @ 95 NONAME
+	_ZN17RadioStationsView20updateCurrentStationEv @ 96 NONAME
+	_ZN17RadioStationsView25updateControlVisibilitiesEv @ 97 NONAME
+	_ZN17RadioStationsView4initEv @ 98 NONAME
+	_ZN17RadioStationsView6renameEv @ 99 NONAME
+	_ZN17RadioStationsView9clearListEv @ 100 NONAME
+	_ZN17RadioStationsView9showEventEP10QShowEvent @ 101 NONAME
+	_ZN17RadioStationsViewC1Ev @ 102 NONAME
+	_ZN17RadioStationsViewC2Ev @ 103 NONAME
+	_ZN17RadioStationsViewD0Ev @ 104 NONAME
+	_ZN17RadioStationsViewD1Ev @ 105 NONAME
+	_ZN17RadioStationsViewD2Ev @ 106 NONAME
+	_ZN19RadioFrequencyStrip10drawPixmapEj5QListI12RadioStationEP18RadioFrequencyItem @ 107 NONAME
+	_ZN19RadioFrequencyStrip11changeEventEP6QEvent @ 108 NONAME
+	_ZN19RadioFrequencyStrip11hideButtonsEv @ 109 NONAME
+	_ZN19RadioFrequencyStrip11initButtonsEv @ 110 NONAME
+	_ZN19RadioFrequencyStrip11qt_metacallEN11QMetaObject4CallEiPPv @ 111 NONAME
+	_ZN19RadioFrequencyStrip11qt_metacastEPKc @ 112 NONAME
+	_ZN19RadioFrequencyStrip11resizeEventEP25QGraphicsSceneResizeEvent @ 113 NONAME
+	_ZN19RadioFrequencyStrip11showButtonsEv @ 114 NONAME
+	_ZN19RadioFrequencyStrip11updateItemsEv @ 115 NONAME
+	_ZN19RadioFrequencyStrip12gestureEventEP13QGestureEvent @ 116 NONAME
+	_ZN19RadioFrequencyStrip12initSelectorEv @ 117 NONAME
+	_ZN19RadioFrequencyStrip12setFrequencyEji @ 118 NONAME
+	_ZN19RadioFrequencyStrip13initPositionsEv @ 119 NONAME
+	_ZN19RadioFrequencyStrip13seekRequestedEi @ 120 NONAME
+	_ZN19RadioFrequencyStrip13skipRequestedEi @ 121 NONAME
+	_ZN19RadioFrequencyStrip13toggleButtonsEv @ 122 NONAME
+	_ZN19RadioFrequencyStrip13updateStationERK11QModelIndexii @ 123 NONAME
+	_ZN19RadioFrequencyStrip14initEmptyItemsEv @ 124 NONAME
+	_ZN19RadioFrequencyStrip14updateFavoriteERK12RadioStation @ 125 NONAME
+	_ZN19RadioFrequencyStrip15addFrequencyPosEijP18RadioFrequencyItem @ 126 NONAME
+	_ZN19RadioFrequencyStrip15checkIllegalPosEv @ 127 NONAME
+	_ZN19RadioFrequencyStrip15mousePressEventEP24QGraphicsSceneMouseEvent @ 128 NONAME
+	_ZN19RadioFrequencyStrip15setScanningModeEb @ 129 NONAME
+	_ZN19RadioFrequencyStrip15updateFavoritesEP18RadioFrequencyItem @ 130 NONAME
+	_ZN19RadioFrequencyStrip16frequencyChangedEji @ 131 NONAME
+	_ZN19RadioFrequencyStrip16handleLeftButtonEv @ 132 NONAME
+	_ZN19RadioFrequencyStrip16scrollPosChangedE7QPointF @ 133 NONAME
+	_ZN19RadioFrequencyStrip16staticMetaObjectE @ 134 NONAME DATA 16
+	_ZN19RadioFrequencyStrip17handleRightButtonEv @ 135 NONAME
+	_ZN19RadioFrequencyStrip17mouseReleaseEventEP24QGraphicsSceneMouseEvent @ 136 NONAME
+	_ZN19RadioFrequencyStrip17scrollToFrequencyEji @ 137 NONAME
+	_ZN19RadioFrequencyStrip17setLeftButtonIconERK6HbIcon @ 138 NONAME
+	_ZN19RadioFrequencyStrip18setRightButtonIconERK6HbIcon @ 139 NONAME
+	_ZN19RadioFrequencyStrip19createItemPrimitiveEP13QGraphicsItem @ 140 NONAME
+	_ZN19RadioFrequencyStrip19getStaticMetaObjectEv @ 141 NONAME
+	_ZN19RadioFrequencyStrip19updateItemPrimitiveEP13QGraphicsItemi @ 142 NONAME
+	_ZN19RadioFrequencyStrip20emitFrequencyChangedEj @ 143 NONAME
+	_ZN19RadioFrequencyStrip20handleLongLeftButtonEv @ 144 NONAME
+	_ZN19RadioFrequencyStrip21handleLongRightButtonEv @ 145 NONAME
+	_ZN19RadioFrequencyStrip4initEP13RadioUiEngine @ 146 NONAME
+	_ZN19RadioFrequencyStrip9initModelEv @ 147 NONAME
+	_ZN19RadioFrequencyStrip9showEventEP10QShowEvent @ 148 NONAME
+	_ZN19RadioFrequencyStripC1Ev @ 149 NONAME
+	_ZN19RadioFrequencyStripC2Ev @ 150 NONAME
+	_ZN20RadioStationCarousel10timerFiredEv @ 151 NONAME
+	_ZN20RadioStationCarousel11qt_metacallEN11QMetaObject4CallEiPPv @ 152 NONAME
+	_ZN20RadioStationCarousel11qt_metacastEPKc @ 153 NONAME
+	_ZN20RadioStationCarousel11setInfoTextEN16CarouselInfoText4TypeE @ 154 NONAME
+	_ZN20RadioStationCarousel12cleanRdsDataEv @ 155 NONAME
+	_ZN20RadioStationCarousel12gestureEventEP13QGestureEvent @ 156 NONAME
+	_ZN20RadioStationCarousel12setFrequencyEji @ 157 NONAME
+	_ZN20RadioStationCarousel13clearInfoTextEv @ 158 NONAME
+	_ZN20RadioStationCarousel13scrollToIndexERK11QModelIndex6QFlagsINS_10ScrollFlagEE @ 159 NONAME
+	_ZN20RadioStationCarousel14setItemVisibleEb @ 160 NONAME
+	_ZN20RadioStationCarousel15insertFrequencyERK11QModelIndexii @ 161 NONAME
+	_ZN20RadioStationCarousel15mousePressEventEP24QGraphicsSceneMouseEvent @ 162 NONAME
+	_ZN20RadioStationCarousel15openContextMenuEP18HbAbstractViewItemRK7QPointF @ 163 NONAME
+	_ZN20RadioStationCarousel15removeFrequencyERK11QModelIndexii @ 164 NONAME
+	_ZN20RadioStationCarousel15setFavoriteIconERK6HbIcon @ 165 NONAME
+	_ZN20RadioStationCarousel15setScanningModeEb @ 166 NONAME
+	_ZN20RadioStationCarousel15updateRadioTextERK12RadioStation @ 167 NONAME
+	_ZN20RadioStationCarousel16frequencyChangedEji @ 168 NONAME
+	_ZN20RadioStationCarousel16setCarouselModelEP18RadioCarouselModel @ 169 NONAME
+	_ZN20RadioStationCarousel16staticMetaObjectE @ 170 NONAME DATA 16
+	_ZN20RadioStationCarousel17animateNewStationERK12RadioStation @ 171 NONAME
+	_ZN20RadioStationCarousel17setAutoScrollTimeEi @ 172 NONAME
+	_ZN20RadioStationCarousel17updateCurrentItemEv @ 173 NONAME
+	_ZN20RadioStationCarousel17updateFrequenciesEv @ 174 NONAME
+	_ZN20RadioStationCarousel18currentStationItemEv @ 175 NONAME
+	_ZN20RadioStationCarousel18setNonFavoriteIconERK6HbIcon @ 176 NONAME
+	_ZN20RadioStationCarousel19getStaticMetaObjectEv @ 177 NONAME
+	_ZN20RadioStationCarousel19updateAntennaStatusEb @ 178 NONAME
+	_ZN20RadioStationCarousel19updateClampingStyleEv @ 179 NONAME
+	_ZN20RadioStationCarousel21scanAnimationFinishedEv @ 180 NONAME
+	_ZN20RadioStationCarousel22initCurrentStationItemEv @ 181 NONAME
+	_ZN20RadioStationCarousel24initToLastTunedFrequencyEv @ 182 NONAME
+	_ZN20RadioStationCarousel24prepareToRemoveFrequencyERK11QModelIndexii @ 183 NONAME
+	_ZN20RadioStationCarousel4initER13RadioUiLoaderP13RadioUiEngine @ 184 NONAME
+	_ZN20RadioStationCarousel4skipEN11StationSkip4ModeE @ 185 NONAME
+	_ZN20RadioStationCarousel6updateERK12RadioStation @ 186 NONAME
+	_ZN20RadioStationCarousel8uiEngineEv @ 187 NONAME
+	_ZN20RadioStationCarousel9updatePosEi @ 188 NONAME
+	_ZN20RadioStationCarouselC1EP13RadioUiEngine @ 189 NONAME
+	_ZN20RadioStationCarouselC2EP13RadioUiEngine @ 190 NONAME
+	_ZNK11RadioWindow10metaObjectEv @ 191 NONAME
+	_ZNK13RadioMainView10metaObjectEv @ 192 NONAME
+	_ZNK16RadioBannerLabel10metaObjectEv @ 193 NONAME
+	_ZNK16RadioFadingLabel10metaObjectEv @ 194 NONAME
+	_ZNK16RadioHistoryView10metaObjectEv @ 195 NONAME
+	_ZNK16RadioHistoryView10taggedIconEv @ 196 NONAME
+	_ZNK16RadioHistoryView12historyModelEv @ 197 NONAME
+	_ZNK16RadioHistoryView13nonTaggedIconEv @ 198 NONAME
+	_ZNK17RadioStationsView10metaObjectEv @ 199 NONAME
+	_ZNK17RadioStationsView12favoriteIconEv @ 200 NONAME
+	_ZNK17RadioStationsView14nowPlayingIconEv @ 201 NONAME
+	_ZNK19RadioFrequencyStrip10metaObjectEv @ 202 NONAME
+	_ZNK19RadioFrequencyStrip11selectorPosEv @ 203 NONAME
+	_ZNK19RadioFrequencyStrip14leftButtonIconEv @ 204 NONAME
+	_ZNK19RadioFrequencyStrip15rightButtonIconEv @ 205 NONAME
+	_ZNK19RadioFrequencyStrip9frequencyEv @ 206 NONAME
+	_ZNK20RadioStationCarousel10metaObjectEv @ 207 NONAME
+	_ZNK20RadioStationCarousel12favoriteIconEv @ 208 NONAME
+	_ZNK20RadioStationCarousel13carouselModelEv @ 209 NONAME
+	_ZNK20RadioStationCarousel14autoScrollTimeEv @ 210 NONAME
+	_ZNK20RadioStationCarousel15nonFavoriteIconEv @ 211 NONAME
+	_ZNK20RadioStationCarousel16isInScanningModeEv @ 212 NONAME
+	_ZNK20RadioStationCarousel17isAntennaAttachedEv @ 213 NONAME
+	_ZTI11RadioWindow @ 214 NONAME
+	_ZTI13RadioMainView @ 215 NONAME
+	_ZTI16RadioBannerLabel @ 216 NONAME
+	_ZTI16RadioFadingLabel @ 217 NONAME
+	_ZTI16RadioHistoryView @ 218 NONAME
+	_ZTI17RadioStationsView @ 219 NONAME
+	_ZTI19RadioFrequencyStrip @ 220 NONAME
+	_ZTI20RadioStationCarousel @ 221 NONAME
+	_ZTV11RadioWindow @ 222 NONAME
+	_ZTV13RadioMainView @ 223 NONAME
+	_ZTV16RadioBannerLabel @ 224 NONAME
+	_ZTV16RadioFadingLabel @ 225 NONAME
+	_ZTV16RadioHistoryView @ 226 NONAME
+	_ZTV17RadioStationsView @ 227 NONAME
+	_ZTV19RadioFrequencyStrip @ 228 NONAME
+	_ZTV20RadioStationCarousel @ 229 NONAME
+	_ZThn16_N13RadioMainViewD0Ev @ 230 NONAME
+	_ZThn16_N13RadioMainViewD1Ev @ 231 NONAME
+	_ZThn16_N16RadioHistoryViewD0Ev @ 232 NONAME
+	_ZThn16_N16RadioHistoryViewD1Ev @ 233 NONAME
+	_ZThn16_N17RadioStationsViewD0Ev @ 234 NONAME
+	_ZThn16_N17RadioStationsViewD1Ev @ 235 NONAME
+	_ZThn8_N11RadioWindowD0Ev @ 236 NONAME
+	_ZThn8_N11RadioWindowD1Ev @ 237 NONAME
+	_ZThn8_N13RadioMainViewD0Ev @ 238 NONAME
+	_ZThn8_N13RadioMainViewD1Ev @ 239 NONAME
+	_ZThn8_N16RadioBannerLabel5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget @ 240 NONAME
+	_ZThn8_N16RadioHistoryViewD0Ev @ 241 NONAME
+	_ZThn8_N16RadioHistoryViewD1Ev @ 242 NONAME
+	_ZThn8_N17RadioStationsViewD0Ev @ 243 NONAME
+	_ZThn8_N17RadioStationsViewD1Ev @ 244 NONAME
+	_ZThn8_N19RadioFrequencyStrip15mousePressEventEP24QGraphicsSceneMouseEvent @ 245 NONAME
+	_ZThn8_N19RadioFrequencyStrip17mouseReleaseEventEP24QGraphicsSceneMouseEvent @ 246 NONAME
+	_ZThn8_N20RadioStationCarousel15mousePressEventEP24QGraphicsSceneMouseEvent @ 247 NONAME
+	_ZN13RadioMainView12userAcceptedEv @ 248 NONAME
+	_ZN16RadioHistoryView12userAcceptedEv @ 249 NONAME
+	_ZN17RadioStationsView10renameDoneEP8HbAction @ 250 NONAME
+	_ZN17RadioStationsView12userAcceptedEv @ 251 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioapp.pro	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,31 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+TEMPLATE = subdirs
+
+# Process directories in order that they are given
+CONFIG += ordered
+
+SUBDIRS += radioenginewrapper
+SUBDIRS += radiopresetstorage
+SUBDIRS += radiouiengine
+SUBDIRS += radiowidgets
+SUBDIRS += radiowidgetsplugin
+SUBDIRS += radioapplication
+
+symbian {
+    BLD_INF_RULES.prj_mmpfiles += $$LITERAL_HASH"include \"../rom/bld.inf\""
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioapplication/inc/radioapplication.h	Fri Jun 04 10:21:36 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:
+*
+*/
+
+#ifndef _RADIOAPPLICATION_H_
+#define _RADIOAPPLICATION_H_
+
+// System includes
+#include <HbApplication>
+
+//#define QT_SHAREDPOINTER_TRACK_POINTERS // Debugging support for QSharedPointer
+#include <QSharedPointer>
+
+// Forward declarations
+class RadioWindow;
+class RadioStationModel;
+
+#ifdef BUILD_WIN32
+    class Win32Window;
+#endif // BUILD_WIN32
+
+// Class declaration
+class RadioApplication : public HbApplication
+{
+    Q_OBJECT
+    Q_DISABLE_COPY( RadioApplication )
+
+public:
+
+    explicit RadioApplication( int &argc, char *argv[] );
+
+    ~RadioApplication();
+
+private slots:
+
+    void init();
+
+private: // data
+
+#ifdef BUILD_WIN32
+    QScopedPointer<Win32Window>     mWin32Window;
+#endif // BUILD_WIN32
+
+    /**
+     * Application main window
+     * Own
+     */
+    QScopedPointer<RadioWindow> mMainWindow;
+
+};
+
+#endif // _RADIOAPPLICATION_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioapplication/inc/testwindow_win32.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef WIN32_WINDOW_H
+#define WIN32_WINDOW_H
+
+// System includes
+#include <QWidget>
+
+// Forward declarations
+class HbMainWindow;
+class QPushButton;
+class QComboBox;
+class QGridLayout;
+
+class Win32Window : public QWidget
+{
+    Q_OBJECT
+public:
+
+    Win32Window();
+    ~Win32Window();
+
+    void addHbWindow( HbMainWindow* radioWindow );
+
+    void init();
+
+private slots:
+
+    void changeOrientation();
+    void volumeUp();
+    void volumeDown();
+    void toggleHeadsetStatus();
+    void updateWindowSize();
+    void addSong();
+    void clearSong();
+    void toggleOffline();
+    void changeTheme( const QString& theme );
+
+private:
+
+    void initThemes();
+    QStringList themeRootPaths();
+
+private: // data
+
+    QPushButton*    mOrientationButton;
+
+    QPushButton*    mVolUpButton;
+    QPushButton*    mVolDownButton;
+
+    QPushButton*    mAddSongButton;
+    QPushButton*    mClearSongButton;
+
+    QPushButton*    mHeadsetButton;
+    bool            mHeadsetConnected;
+
+    QPushButton*    mOfflineButton;
+
+    QComboBox*      mThemeBox;
+
+    QGridLayout*    mToolbarLayout;
+
+    int             mVolume;
+
+    HbMainWindow*   mRadioWindow;
+
+    Qt::Orientation mOrientation;
+
+    int             mSongIndex;
+
+};
+
+#endif // WIN32_WINDOW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioapplication/radioapplication.pro	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,66 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+include(../buildflags.pri)
+
+TEMPLATE        = app
+TARGET          = qtfmradio
+TRANSLATIONS    += fmradio.ts 
+
+symbian: {
+    TARGET.CAPABILITY       = CAP_APPLICATION MultimediaDD
+    TARGET.VID              = VID_DEFAULT
+    TARGET.UID3             = 0x101FF976 # Old visual radio uid
+    TARGET.EPOCSTACKSIZE    = 0x14000
+    TARGET.EPOCHEAPSIZE     = 0x020000 0x2400000
+}
+
+CONFIG      += hb service
+
+# Service provider specific configuration.
+SERVICE.FILE = resources/service_conf.xml
+
+INCLUDEPATH += . inc
+INCLUDEPATH += ../commoninc
+INCLUDEPATH += ../radiouiengine/inc
+INCLUDEPATH += ../radiowidgets/inc
+
+LIBS        += -lradiouiengine
+LIBS        += -lradiowidgets
+
+# UI does not normally depend on the wrapper, but it does on two special cases
+# 1. Logging is enabled. The logger is in the wrapper module
+# 2. Radio is built for win32 target. The test window needs to access the wrapper
+LOGGING_ENABLED:LIBS += -lradioenginewrapper
+
+# Sources
+HEADERS     += radioapplication.h
+
+SOURCES     += main.cpp
+SOURCES     += radioapplication.cpp
+
+# Win32 specific stuff
+win32: {
+    LIBS += -lradioenginewrapper
+
+    HEADERS += testwindow_win32.h
+
+    SOURCES += testwindow_win32.cpp
+
+    DEFINES += HB_RESOURCES_DIR=\"\\\"$${HB_RESOURCES_DIR}\\\"\"
+}
+
+DEPENDPATH  += $$INCLUDEPATH src
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioapplication/resources/compile_ts.bat	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,36 @@
+@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
+@echo off
+
+set QM_FILE_US=fmradio_en_US.qm
+set QM_FILE=fmradio_en.qm
+set QM_LOCATION=..\..\bin\%QM_FILE_US%
+
+ECHO Creating QM file
+call lrelease -idbased fmradio.ts -qm %QM_LOCATION%
+
+IF EXIST \epoc32\tools\epoc.bat (
+    echo Copying files to epoc32
+    xcopy /y fmradio.ts \epoc32\include\platform\qt\translations\fmradio_en.ts
+    xcopy /y fmradio.ts \epoc32\include\platform\qt\translations\fmradio_en_US.ts
+    
+    xcopy /y %QM_LOCATION% \epoc32\data\z\resource\qt\translations\%QM_FILE%
+    xcopy /y %QM_LOCATION% \epoc32\release\winscw\udeb\z\resource\qt\translations\%QM_FILE%
+    xcopy /y %QM_LOCATION% \epoc32\release\winscw\urel\z\resource\qt\translations\%QM_FILE%
+    xcopy /y %QM_LOCATION% \epoc32\data\z\resource\qt\translations\%QM_FILE_US%
+    xcopy /y %QM_LOCATION% \epoc32\release\winscw\udeb\z\resource\qt\translations\%QM_FILE_US%
+    xcopy /y %QM_LOCATION% \epoc32\release\winscw\urel\z\resource\qt\translations\%QM_FILE_US%
+)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioapplication/resources/fmradio.ts	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,2198 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="3.0" language="en_GB" sourcelanguage="en_GB">
+<context>
+<message numerus="no" id="txt_rad_dialog_new_name">
+    <comment>Dialog title for renaming the station. </comment>        
+    <source>New name:</source>
+    <translation variants="no">New name:</translation>
+    <extra-loc-layout_id>qtl_dialog_pri_heading</extra-loc-layout_id>    
+    <extra-loc-viewid>rad</extra-loc-viewid>
+    <extra-loc-positionid>dialog</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_rock_music">
+    <comment>Main view Information area item. Displayed if PTY is available. RDS Programme Type identifier for PTY code 11.</comment>        
+    <source>Rock Music</source>
+    <translation variants="no">Rock Music</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_personality">
+    <comment>Main view Information area item. Displayed if PTY is available. Used only in US region.</comment>        
+    <source>Personality</source>
+    <translation variants="no">Personality</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_clear_recently_played_songs_list">
+    <comment>Dialog text displayed when user is about to clear all recently played songs in Recently played songs view.</comment>        
+    <source>Clear Recently played songs list?</source>
+    <translation variants="no">Clear Recently played songs list?</translation>
+    <extra-loc-layout_id>qtl_dialog_pri5</extra-loc-layout_id>    
+    <extra-loc-viewid>rad</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_opt_play_history">
+    <comment>Options list item in main view. Opens Play history view.</comment>        
+    <source>Play history</source>
+    <translation variants="no">Play history</translation>
+    <extra-loc-layout_id>qtl_menu_pri</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>opt</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_recently_played_songs_collects_song2">
+    <comment>Info text in main pane area if Recently played songs has no item (e.g. after the user has emptied the list). Note that &quot;Identify song&quot; must be the same string as txt_rad_list_identify_song. &quot;Recently played songs&quot; text must be the same as &quot;Recently played songs&quot; text must be the same as txt_rad_button_recently_played_songs. Displayed if Shazam (song identification) application is NOT installed to the device.</comment>        
+    <source>Recently played songs collects song information from radio stations which send the song information using RDS+ technology.</source>
+    <translation variants="no">Recently played songs collects song information from radio stations which send the song information using RDS+ technology.</translation>
+    <extra-loc-layout_id>qtl_view_empty_description_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_03</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_common_button_cancel">
+    <comment>Button. Ignores the dialog and returns previous view</comment>        
+    <source>Cancel</source>
+    <translation variants="no">Cancel</translation>
+    <extra-loc-layout_id>qtl_dialog_softkey</extra-loc-layout_id>    
+    <extra-loc-viewid>common</extra-loc-viewid>
+    <extra-loc-positionid>button</extra-loc-positionid>
+    <extra-loc-feature>co</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_alarm_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Alarm</source>
+    <translation variants="no">Alarm</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_news">
+    <comment>Main view Information area item. Displayed if PTY is available. RDS Programme Type identifier for PTY code 1.</comment>        
+    <source>News</source>
+    <translation variants="no">News</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_opt_search_all_stations">
+    <comment>Options list item. Initiates a functionality that scans through the whole frequency range and saves the found stations. Note! Displayed in main view and in Stations view.</comment>        
+    <source>Search all stations</source>
+    <translation variants="no">Search all stations</translation>
+    <extra-loc-layout_id>qtl_menu_pri</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01, rad_02</extra-loc-viewid>
+    <extra-loc-positionid>opt</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_light_classical_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Light classical</source>
+    <translation variants="no">Light classical</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_culture">
+    <comment>Main view Information area item. Displayed if PTY is available. RDS Programme Type identifier for PTY code 7.</comment>        
+    <source>Culture</source>
+    <translation variants="no">Culture</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_soft_rhythm_and_blues">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Soft rhythm and blues</source>
+    <translation variants="no">Soft rhythm and blues</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_country_music">
+    <comment>Main view Information area item. Displayed if PTY is available. RDS Programme Type identifier for PTY code 25.</comment>        
+    <source>Country Music</source>
+    <translation variants="no">Country Music</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_fmradio_info_local_frequency_band_automaticall">
+    <comment>Discreet popup notification text. Displayed after region has been automatically selected.</comment>        
+    <source>Local frequency band automatically set for radio.</source>
+    <translation variants="no">Local frequency band automatically set for radio.</translation>
+    <extra-loc-layout_id>qtl_notifdialog_pri2</extra-loc-layout_id>    
+    <extra-loc-viewid>fmradio</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>fm</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_val_l1_mhz">
+    <comment>Two row list, second row. %L1 frequency of a station. Note! Only used if the station does not have a name. Only in landscape.</comment>        
+    <source>%L1 MHz</source>
+    <translation variants="no">%L1 MHz</translation>
+    <extra-loc-layout_id>qtl_list_sec2_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_03</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_rock_music">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Rock Music</source>
+    <translation variants="no">Rock Music</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_button_tagged_songs">
+    <comment>Button text. Expresses that the list contains songs which have been marked as favorite songs.</comment>        
+    <source>Tagged songs</source>
+    <translation variants="no">Tagged songs</translation>
+    <extra-loc-layout_id>qtl_toolbar_tiny_2</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_03</extra-loc-viewid>
+    <extra-loc-positionid>button</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_soft_rock">
+    <comment>Main view Information area item. Displayed if PTY is available. Used only in US region.</comment>        
+    <source>Soft rock</source>
+    <translation variants="no">Soft rock</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_religious_talk_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Religious talk</source>
+    <translation variants="no">Religious talk</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_culture">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Culture</source>
+    <translation variants="no">Culture</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_menu_search_via_shazam">
+    <comment>Item specific menu item. Opens a Shazam application where user can search song related services.</comment>        
+    <source>Search via Shazam</source>
+    <translation variants="no">Search via Shazam</translation>
+    <extra-loc-layout_id>qtl_menu_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_03</extra-loc-viewid>
+    <extra-loc-positionid>menu</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_nostalgia">
+    <comment>Main view Information area item. Displayed if PTY is available. Used only in US region.</comment>        
+    <source>Nostalgia</source>
+    <translation variants="no">Nostalgia</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_social_affairs">
+    <comment>Main view Information area item. Displayed if PTY is available. RDS Programme Type identifier for PTY code 19.</comment>        
+    <source>Social Affairs</source>
+    <translation variants="no">Social Affairs</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_opt_clear_list">
+    <comment>Options list item. Empties the Recently played songs or Tagged songs list. </comment>        
+    <source>Clear list</source>
+    <translation variants="no">Clear list</translation>
+    <extra-loc-layout_id>qtl_menu_pri</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_03</extra-loc-viewid>
+    <extra-loc-positionid>opt</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_other_music">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Other Music</source>
+    <translation variants="no">Other Music</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_classical_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Classical</source>
+    <translation variants="no">Classical</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_national_music_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>National Music</source>
+    <translation variants="no">National Music</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_rhythm_and_blues">
+    <comment>Main view Information area item. Displayed if PTY is available. Used only in US region.</comment>        
+    <source>Rhythm and blues</source>
+    <translation variants="no">Rhythm and blues</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_religious_talk">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Religious talk</source>
+    <translation variants="no">Religious talk</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_button_activate_loudspeaker">
+    <comment>A button text in main view. Displayed if volume is coming from the headset. Activating the function routes audio to the loudspeaker.</comment>        
+    <source>Activate loudspeaker</source>
+    <translation variants="no">Activate loudspeaker</translation>
+    <extra-loc-layout_id>txt_rad_button_stations</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>button</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_other_music_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Other Music</source>
+    <translation variants="no">Other Music</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_religion_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Religion</source>
+    <translation variants="no">Religion</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_nostalgia">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Nostalgia</source>
+    <translation variants="no">Nostalgia</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_common_menu_delete">
+    <comment>Item specific menu item. Allows the user to delete a station.</comment>        
+    <source>Delete</source>
+    <translation variants="no">Delete</translation>
+    <extra-loc-layout_id>qtl_menu_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>common</extra-loc-viewid>
+    <extra-loc-positionid>menu</extra-loc-positionid>
+    <extra-loc-feature>co</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_language">
+    <comment>Main view Information area item. Displayed if PTY is available. Used only in US region.</comment>        
+    <source>Language</source>
+    <translation variants="no">Language</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_talk">
+    <comment>Main view Information area item. Displayed if PTY is available. Used only in US region.</comment>        
+    <source>Talk</source>
+    <translation variants="no">Talk</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_common_menu_rename_item">
+    <comment>Item specific menu item. Allows the user to define a new name for a station.</comment>        
+    <source>Rename</source>
+    <translation variants="no">Rename</translation>
+    <extra-loc-layout_id>qtl_menu_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>common</extra-loc-viewid>
+    <extra-loc-positionid>menu</extra-loc-positionid>
+    <extra-loc-feature>co</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_soft_rhythm_and_blues">
+    <comment>Main view Information area item. Displayed if PTY is available. Used only in US region.</comment>        
+    <source>Soft rhythm and blues</source>
+    <translation variants="no">Soft rhythm and blues</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_documentary_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Documentary</source>
+    <translation variants="no">Documentary</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_education_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Education</source>
+    <translation variants="no">Education</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_national_music">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>National Music</source>
+    <translation variants="no">National Music</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_science">
+    <comment>Main view Information area item. Displayed if PTY is available. RDS Programme Type identifier for PTY code 8.</comment>        
+    <source>Science</source>
+    <translation variants="no">Science</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_pop_music_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Pop Music</source>
+    <translation variants="no">Pop Music</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_list_l1_mhz">
+    <comment>Text in a home screen widget information area. %L1 is the radio station&apos;s frequency.</comment>        
+    <source>%L1 Mhz</source>
+    <translation variants="no">%L1 Mhz</translation>
+    <extra-loc-layout_id>txt_rad_list_l1_mhz</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>list</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_weather">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Weather</source>
+    <translation variants="no">Weather</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_drama">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Drama</source>
+    <translation variants="no">Drama</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_national_music">
+    <comment>Main view Information area item. Displayed if PTY is available. RDS Programme Type identifier for PTY code 26.</comment>        
+    <source>National Music</source>
+    <translation variants="no">National Music</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_culture_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Culture</source>
+    <translation variants="no">Culture</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_finance_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Finance</source>
+    <translation variants="no">Finance</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_religious_music">
+    <comment>Main view Information area item. Displayed if PTY is available. Used only in US region.</comment>        
+    <source>Religious music</source>
+    <translation variants="no">Religious music</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_oldies_music">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Oldies Music</source>
+    <translation variants="no">Oldies Music</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_education">
+    <comment>Main view Information area item. Displayed if PTY is available. RDS Programme Type identifier for PTY code 5.</comment>        
+    <source>Education</source>
+    <translation variants="no">Education</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_common_button_no">
+    <comment>Button. Pressing this button rejects the selected operation.</comment>        
+    <source>No</source>
+    <translation variants="no">No</translation>
+    <extra-loc-layout_id>qtl_dialog_softkey</extra-loc-layout_id>    
+    <extra-loc-viewid>common</extra-loc-viewid>
+    <extra-loc-positionid>button</extra-loc-positionid>
+    <extra-loc-feature>co</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_common_button_ok">
+    <comment>Button. Allows the user to accept the dialog and return to previous view</comment>        
+    <source>OK</source>
+    <translation variants="no">OK</translation>
+    <extra-loc-layout_id>qtl_dialog_softkey</extra-loc-layout_id>    
+    <extra-loc-viewid>common</extra-loc-viewid>
+    <extra-loc-positionid>button</extra-loc-positionid>
+    <extra-loc-feature>co</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_social_affairs_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Social Affairs</source>
+    <translation variants="no">Social Affairs</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_no_favourites_add_favourites_to_see">
+    <comment>Info text in main pane if &quot;Favourites&quot; list has no items. &quot;Favourite stations&quot; text must be same localization as txt_rad_subhead_favorite_stations. Favourite icon refers to a star -icon in the main view.</comment>        
+    <source>You can mark your favourite stations in All stations view by long tapping the station and selecting Add favourite. You can also tap the favourite icon in main view to mark it as a favorite.</source>
+    <translation variants="no">You can mark your favourite stations in All stations view by long tapping the station and selecting Add favourite. You can also tap the favourite icon in main view to mark it as a favorite.</translation>
+    <extra-loc-layout_id>qtl_view_empty_description_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_clear_favourite_stations_list">
+    <comment>Dialog text displayed when user is about to clear the all stations in Favourite stations view.</comment>        
+    <source>Clear Favourite stations list?</source>
+    <translation variants="no">Clear Favourite stations list?</translation>
+    <extra-loc-layout_id>qtl_dialog_pri5</extra-loc-layout_id>    
+    <extra-loc-viewid>rad</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_adult_hits">
+    <comment>Main view Information area item. Displayed if PTY is available. Used only in US region.</comment>        
+    <source>Adult hits</source>
+    <translation variants="no">Adult hits</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_no_favourite_stations">
+    <comment>Title of the info text in main pane if &quot;Favourite stations&quot; list has no items. </comment>        
+    <source>(No favourite stations)</source>
+    <translation variants="no">(No favourite stations)</translation>
+    <extra-loc-layout_id>qtl_view_empty_title_pri</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_button_stations">
+    <comment>A button text in main view. Opens a Stations list view, which lists All stations and Favourite stations views.</comment>        
+    <source>Stations</source>
+    <translation variants="no">Stations</translation>
+    <extra-loc-layout_id>txt_rad_button_stations</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>button</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dialog_long_press_arrow_keys_to_search_str">
+    <comment>Help text displayed in main view station information area. Displayed if no stations have been marked as favourites and user presses previous or next button.</comment>        
+    <source>Mark favourite stations by pressing the star icon to enable navigation with short arrow presses. You can also swipe here to navigate between all stations. Long press arrow keys to search strong signal stations. </source>
+    <translation variants="no">Mark favourite stations by pressing the star icon to enable navigation with short arrow presses. You can also swipe here to navigate between all stations. Long press arrow keys to search strong signal stations. </translation>
+    <extra-loc-layout_id>txt_rad_dialog_long_press_arrow_keys_to_search_str</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_pop_music">
+    <comment>Main view Information area item. Displayed if PTY is available. RDS Programme Type identifier for PTY code 10.</comment>        
+    <source>Pop Music</source>
+    <translation variants="no">Pop Music</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_varied">
+    <comment>Main view Information area item. Displayed if PTY is available. RDS Programme Type identifier for PTY code 9.</comment>        
+    <source>Varied</source>
+    <translation variants="no">Varied</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_alarm_test_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Alarm Test</source>
+    <translation variants="no">Alarm Test</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_alarm">
+    <comment>Main view Information area item. Displayed if PTY is available. RDS Programme Type identifier for PTY code 31.</comment>        
+    <source>Alarm</source>
+    <translation variants="no">Alarm</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_other_music">
+    <comment>Main view Information area item. Displayed if PTY is available. RDS Programme Type identifier for PTY code 15.</comment>        
+    <source>Other Music</source>
+    <translation variants="no">Other Music</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_long_caption_fm_radio">
+    <comment>Application menu item name in list. Long caption.</comment>        
+    <source>FM Radio</source>
+    <translation variants="no">FM Radio</translation>
+    <extra-loc-layout_id>qtl_list_pri_large_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>fmradio</extra-loc-viewid>
+    <extra-loc-positionid>list</extra-loc-positionid>
+    <extra-loc-feature>fm</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_childrens_programmes">
+    <comment>Main view Information area item. Displayed if PTY is available. RDS Programme Type identifier for PTY code 18.</comment>        
+    <source>Children’s programmes</source>
+    <translation variants="no">Children’s programmes</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_varied">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Varied</source>
+    <translation variants="no">Varied</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_leisure">
+    <comment>Main view Information area item. Displayed if PTY is available. RDS Programme Type identifier for PTY code 23.</comment>        
+    <source>Leisure</source>
+    <translation variants="no">Leisure</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_alarm">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Alarm</source>
+    <translation variants="no">Alarm</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_information">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Information</source>
+    <translation variants="no">Information</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_menu_remove_favourite">
+    <comment>Item specific menu item. Allows the user to remove station from the favourite station list.</comment>        
+    <source>Remove from favourites</source>
+    <translation variants="no">Remove from favourites</translation>
+    <extra-loc-layout_id>qtl_menu_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>menu</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_recently_played_songs_collects_song_i">
+    <comment>Info text in main pane area if Recently played songs list has no item (e.g. after the user has emptied the list). Note that &quot;Identify song&quot; must be the same string as txt_rad_list_identify_song. &quot;Recently played songs&quot; text must be the same as txt_rad_button_recently_played_songs. Displayed if Shazam (song identification) application is installed to the device.</comment>        
+    <source>Recently played songs collects song information from radio stations which send the song information using RDS+ technology.
+Also songs which are identified with â€Identify song†functionality in main view are displayed here.</source>
+    <translation variants="no">Recently played songs collects song information from radio stations which send the song information using RDS+ technology.
+Also songs which are identified with â€Identify song†functionality in main view are displayed here.</translation>
+    <extra-loc-layout_id>qtl_view_empty_description_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_03</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_title_fm_radio">
+    <comment>View title, shown in all FM Radio views.</comment>        
+    <source>FM Radio</source>
+    <translation variants="no">FM Radio</translation>
+    <extra-loc-layout_id>qtl_titlebar</extra-loc-layout_id>    
+    <extra-loc-viewid>rad</extra-loc-viewid>
+    <extra-loc-positionid>title</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_button_cancel">
+    <comment>Button which is displayed during the search all stations function on the main view.</comment>        
+    <source>Cancel</source>
+    <translation variants="no">Cancel</translation>
+    <extra-loc-layout_id>txt_rad_button_cancel</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>button</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_religious_music_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Religious music</source>
+    <translation variants="no">Religious music</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_delete_station">
+    <comment>Confirmation query for deleting a selected station.</comment>        
+    <source>Delete station?</source>
+    <translation variants="no">Delete station?</translation>
+    <extra-loc-layout_id>qtl_dialog_pri5</extra-loc-layout_id>    
+    <extra-loc-viewid>rad</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_religion">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Religion</source>
+    <translation variants="no">Religion</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_soft_rock_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Soft rock</source>
+    <translation variants="no">Soft rock</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_menu_add_to_favourites">
+    <comment>Item specific menu item. Allows the user to add a local station to favourite stations list. Available only if the station item is not already in the favourites.</comment>        
+    <source>Add to favourites</source>
+    <translation variants="no">Add to favourites</translation>
+    <extra-loc-layout_id>qtl_menu_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>menu</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_current_affairs">
+    <comment>Main view Information area item. Displayed if PTY is available. RDS Programme Type identifier for PTY code 2.</comment>        
+    <source>Current affairs</source>
+    <translation variants="no">Current affairs</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_drama_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Drama</source>
+    <translation variants="no">Drama</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_you_can_add_song_to_the_tagged_songs">
+    <comment>Info text in main pane area if Tagged songs list has no item (e.g. after the user has deleted all content from the list). Note that &quot;tagged songs&quot; must use the same localisation as txt_rad_button_tagged_songs. Recently played songs must be same as &quot;Recently played songs&quot; text must be the same as txt_rad_button_recently_played_songs..</comment>        
+    <source>You can add song to the tagged songs list from Recently played songs or from main view if song is identified by FM Radio. </source>
+    <translation variants="no">You can add song to the tagged songs list from Recently played songs or from main view if song is identified by FM Radio. </translation>
+    <extra-loc-layout_id>qtl_view_empty_description_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_03</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_social_affairs">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Social Affairs</source>
+    <translation variants="no">Social Affairs</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_education">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Education</source>
+    <translation variants="no">Education</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_jazz_music">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Jazz Music</source>
+    <translation variants="no">Jazz Music</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_religious_music">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Religious music</source>
+    <translation variants="no">Religious music</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_continue_using_the_radio_in_offline">
+    <comment>Confirmation query text which is displayed when the FM radio is on and device is switched to offline mode.</comment>        
+    <source>Continue using the Radio in off-line mode?</source>
+    <translation variants="no">Continue using the Radio in off-line mode?</translation>
+    <extra-loc-layout_id>qtl_dialog_pri5</extra-loc-layout_id>    
+    <extra-loc-viewid>rad</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_list_unknown">
+    <comment>First row of the two row list item. Displayed only on landscape! Displayed when the artist name is not available for the identified song. %1 is the song name. In landscape the whole string is &quot;(Unknown) - Song name&quot; e.g. &quot;(Unknown) - Like a Virgin</comment>        
+    <source>(Unknown) - %1</source>
+    <translation variants="no">(Unknown) - %1</translation>
+    <extra-loc-layout_id>qtl_list_pri_large_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_03</extra-loc-viewid>
+    <extra-loc-positionid>dblist</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_travel">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Travel</source>
+    <translation variants="no">Travel</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_soft_rhythm_and_blues_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Soft rhythm and blues</source>
+    <translation variants="no">Soft rhythm and blues</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_clear_all_stations_list">
+    <comment>Dialog text displayed when user is about to clear the all stations in All stations view.</comment>        
+    <source>Clear All stations list?</source>
+    <translation variants="no">Clear All stations list?</translation>
+    <extra-loc-layout_id>qtl_dialog_pri5</extra-loc-layout_id>    
+    <extra-loc-viewid>rad</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_classical">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Classical</source>
+    <translation variants="no">Classical</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dpophead_song_was_added_to_favorite_songs">
+    <comment>Discreet popup heading text. Displayed in main view when a song has been tagged. </comment>        
+    <source>Song was added to Tagged songs.</source>
+    <translation variants="no">Song was added to Tagged songs.</translation>
+    <extra-loc-layout_id>qtl_notifdialog_pri2_medium_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad</extra-loc-viewid>
+    <extra-loc-positionid>dpophead</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_talk">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Talk</source>
+    <translation variants="no">Talk</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_common_button_yes">
+    <comment>Button. Pressing this button confirms the selected operation.</comment>        
+    <source>Yes</source>
+    <translation variants="no">Yes</translation>
+    <extra-loc-layout_id>qtl_dialog_softkey</extra-loc-layout_id>    
+    <extra-loc-viewid>common</extra-loc-viewid>
+    <extra-loc-positionid>button</extra-loc-positionid>
+    <extra-loc-feature>co</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_finance">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Finance</source>
+    <translation variants="no">Finance</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_country_music_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Country Music</source>
+    <translation variants="no">Country Music</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_activate_radio_in_offline_mode">
+    <comment>Confirmation query which is displayed when the FM Radio is launched while the device is in offline mode.</comment>        
+    <source>Activate Fm Radio in off-line mode?</source>
+    <translation variants="no">Activate Fm Radio in off-line mode?</translation>
+    <extra-loc-layout_id>qtl_dialog_pri5</extra-loc-layout_id>    
+    <extra-loc-viewid>rad</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_searching_local_stations_please_wait">
+    <comment>Progress dialog text. Displayed when the system is scanning the whole frequency range for strong signal stations. </comment>        
+    <source>Searching local stations. Please wait.</source>
+    <translation variants="no">Searching local stations. Please wait.</translation>
+    <extra-loc-layout_id>qtl_dialog_pri3</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_04</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz2">
+    <comment>Second row of two row list item. %L1 is the frequency value of the station. Displayed if station HAS a name which is displayed on the first row.</comment>        
+    <source>%L1 MHz</source>
+    <translation variants="no">%L1 MHz</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_soft_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Soft</source>
+    <translation variants="no">Soft</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_drama">
+    <comment>Main view Information area item. Displayed if PTY is available. RDS Programme Type identifier for PTY code 6.</comment>        
+    <source>Drama</source>
+    <translation variants="no">Drama</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_common_opt_deactivate_loudspeaker">
+    <comment>Options list item. Deactivates the loudspeaker. Only available if audio can be routed to the headset</comment>        
+    <source>Deactivate loudspeaker</source>
+    <translation variants="no">Deactivate loudspeaker</translation>
+    <extra-loc-layout_id>qtl_menu_pri</extra-loc-layout_id>    
+    <extra-loc-viewid>common</extra-loc-viewid>
+    <extra-loc-positionid>opt</extra-loc-positionid>
+    <extra-loc-feature>co</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_clear_tagged_songs_list">
+    <comment>Dialog text displayed when user is about to clear all tagged songs in Tagged songs view.</comment>        
+    <source>Clear Tagged songs list?</source>
+    <translation variants="no">Clear Tagged songs list?</translation>
+    <extra-loc-layout_id>qtl_dialog_pri5</extra-loc-layout_id>    
+    <extra-loc-viewid>rad</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_top_40">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Top 40</source>
+    <translation variants="no">Top 40</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_phone_in_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Phone In</source>
+    <translation variants="no">Phone In</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_list_searching_all_available_stations_ple">
+    <comment>Main pane Information area item. Displayed below the tuning animation during the first time startup.</comment>        
+    <source>Searching all available stations. Please wait.</source>
+    <translation variants="no">Searching all available stations. Please wait.</translation>
+    <extra-loc-layout_id>txt_rad_info_connect_wired_headset</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_leisure_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Leisure</source>
+    <translation variants="no">Leisure</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_college">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>College</source>
+    <translation variants="no">College</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_all_stations_in_stations_list_will_be">
+    <comment>Confirmation query displayed when user is about to start scanning of all the available stations. </comment>        
+    <source>Stations in station list will be replaced. Favourite stations won&apos;t be touched. Continue?</source>
+    <translation variants="no">Stations in station list will be replaced. Favourite stations won&apos;t be touched. Continue?</translation>
+    <extra-loc-layout_id>qtl_dialog_pri5</extra-loc-layout_id>    
+    <extra-loc-viewid>rad</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_menu_tag_song">
+    <comment>Item specific menu item. Allows the user to add a song in play history list to tagged songs list. Available only if the item is not already in the tagged songs.</comment>        
+    <source>Tag song</source>
+    <translation variants="no">Tag song</translation>
+    <extra-loc-layout_id>qtl_menu_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01, rad_03</extra-loc-viewid>
+    <extra-loc-positionid>menu</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_no_stations_search_stations_automat">
+    <comment>Info text in main pane if &quot;All stations&quot; list has no items. Activates the search all station function if user taps the text.</comment>        
+    <source>Search stations automatically by tapping here.</source>
+    <translation variants="no">Search stations automatically by tapping here.</translation>
+    <extra-loc-layout_id>qtl_view_empty_description_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_college">
+    <comment>Main view Information area item. Displayed if PTY is available. Used only in US region.</comment>        
+    <source>College</source>
+    <translation variants="no">College</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_news_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>News</source>
+    <translation variants="no">News</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_list_fm_radio">
+    <comment>Text in a home screen widget information area. Displayed when no station is tuned.</comment>        
+    <source>FM Radio</source>
+    <translation variants="no">FM Radio</translation>
+    <extra-loc-layout_id>txt_rad_list_fm_radio</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>list</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_pop_music">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Pop Music</source>
+    <translation variants="no">Pop Music</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_top_40_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Top 40</source>
+    <translation variants="no">Top 40</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_public">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Public</source>
+    <translation variants="no">Public</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_nostalgia_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Nostalgia</source>
+    <translation variants="no">Nostalgia</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_fmradio_info_fm_radio_could_not_be_started">
+    <comment>Dialog text which is displayed if FM Radio cannot be started for e.g. very low system memory or other rare cases.</comment>        
+    <source>FM Radio could not be started. </source>
+    <translation variants="no">FM Radio could not be started. </translation>
+    <extra-loc-layout_id>qtl_dialog_pri5</extra-loc-layout_id>    
+    <extra-loc-viewid>fmradio</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>fm</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_no_stations">
+    <comment>Title of the info text in main pane if &quot;All stations&quot; list has no items. </comment>        
+    <source>(No stations)</source>
+    <translation variants="no">(No stations)</translation>
+    <extra-loc-layout_id>qtl_view_empty_title_pri</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_short_caption_fm_radio">
+    <comment>Application menu item name in grid. Short caption.</comment>        
+    <source>FM Radio</source>
+    <translation variants="no">FM Radio</translation>
+    <extra-loc-layout_id>qtl_grid_applications_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>fmradio</extra-loc-viewid>
+    <extra-loc-positionid>grid</extra-loc-positionid>
+    <extra-loc-feature>fm</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_common_opt_exit">
+    <comment>Options list item. With the exit option, the user can close the currently active application and return to the Home screen.</comment>        
+    <source>Exit</source>
+    <translation variants="no">Exit</translation>
+    <extra-loc-layout_id>qtl_menu_pri</extra-loc-layout_id>    
+    <extra-loc-viewid>common</extra-loc-viewid>
+    <extra-loc-positionid>opt</extra-loc-positionid>
+    <extra-loc-feature>co</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_serious_classical">
+    <comment>Main view Information area item. Displayed if PTY is available. RDS Programme Type identifier for PTY code 14.</comment>        
+    <source>Serious classical</source>
+    <translation variants="no">Serious classical</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_religion">
+    <comment>Main view Information area item. Displayed if PTY is available. RDS Programme Type identifier for PTY code 20.</comment>        
+    <source>Religion</source>
+    <translation variants="no">Religion</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_easy_listening">
+    <comment>Main view Information area item. Displayed if PTY is available. RDS Programme Type identifier for PTY code 12.</comment>        
+    <source>Easy Listening</source>
+    <translation variants="no">Easy Listening</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_classical">
+    <comment>Main view Information area item. Displayed if PTY is available. Used only in US region.</comment>        
+    <source>Classical</source>
+    <translation variants="no">Classical</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_rock_music_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Rock Music</source>
+    <translation variants="no">Rock Music</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dpophead_no_stations_found_try_searching">
+    <comment>Discreet popup heading text. Displayed when no stations were found after search all stations function has been finished.</comment>        
+    <source>No stations found. Try searching stations by scrolling the frequency strip.</source>
+    <translation variants="no">No stations found. Try searching stations by scrolling the frequency strip.</translation>
+    <extra-loc-layout_id>qtl_notifdialog_pri2</extra-loc-layout_id>    
+    <extra-loc-viewid>rad</extra-loc-viewid>
+    <extra-loc-positionid>dpophead</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_sport">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Sport</source>
+    <translation variants="no">Sport</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_tsw_caption_fm_radio">
+    <comment>Application name in Task switcher.</comment>        
+    <source>FM Radio</source>
+    <translation variants="no">FM Radio</translation>
+    <extra-loc-layout_id>txt_tsw_caption_fmradio</extra-loc-layout_id>    
+    <extra-loc-viewid>tsw_01</extra-loc-viewid>
+    <extra-loc-positionid>caption</extra-loc-positionid>
+    <extra-loc-feature>ts</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_subhead_play_history">
+    <comment>Heading text for the Play history view.</comment>        
+    <source>Play history</source>
+    <translation variants="no">Play history</translation>
+    <extra-loc-layout_id>qtl_groupbox_simple_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_03</extra-loc-viewid>
+    <extra-loc-positionid>subhead</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_oldies_music_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Oldies Music</source>
+    <translation variants="no">Oldies Music</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_menu_remove_tag">
+    <comment>Item specific menu item. Allows the user to remove a song from the tagged songs list.</comment>        
+    <source>Remove tag</source>
+    <translation variants="no">Remove tag</translation>
+    <extra-loc-layout_id>qtl_menu_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_03</extra-loc-viewid>
+    <extra-loc-positionid>menu</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_sport_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Sport</source>
+    <translation variants="no">Sport</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_classic_rock_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Classic rock</source>
+    <translation variants="no">Classic rock</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_personality">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Personality</source>
+    <translation variants="no">Personality</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_language">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Language</source>
+    <translation variants="no">Language</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_current_affairs">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Current affairs</source>
+    <translation variants="no">Current affairs</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_soft">
+    <comment>Main view Information area item. Displayed if PTY is available. Used only in US region.</comment>        
+    <source>Soft</source>
+    <translation variants="no">Soft</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_button_local_stations">
+    <comment>Toolbar button. Displays list of all radio stations.</comment>        
+    <source>All stations</source>
+    <translation variants="no">All stations</translation>
+    <extra-loc-layout_id>qtl_toolbar_tiny_2</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>button</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_serious_classical">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Serious classical</source>
+    <translation variants="no">Serious classical</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_sport">
+    <comment>Main view Information area item. Displayed if PTY is available. RDS Programme Type identifier for PTY code 4.</comment>        
+    <source>Sport</source>
+    <translation variants="no">Sport</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_weather">
+    <comment>Main view Information area item. Displayed if PTY is available. RDS Programme Type identifier for PTY code 16.</comment>        
+    <source>Weather</source>
+    <translation variants="no">Weather</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_science">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Science</source>
+    <translation variants="no">Science</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_classic_rock">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Classic rock</source>
+    <translation variants="no">Classic rock</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_soft_rock">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Soft rock</source>
+    <translation variants="no">Soft rock</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_light_classical">
+    <comment>Main view Information area item. Displayed if PTY is available. RDS Programme Type identifier for PTY code 13.</comment>        
+    <source>Light classical</source>
+    <translation variants="no">Light classical</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_folk_music">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Folk Music</source>
+    <translation variants="no">Folk Music</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_phone_in">
+    <comment>Main view Information area item. Displayed if PTY is available. RDS Programme Type identifier for PTY code 21.</comment>        
+    <source>Phone In</source>
+    <translation variants="no">Phone In</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_button_favourites">
+    <comment>Toolbar button. Displays list of all favourite radio stations.</comment>        
+    <source>Favourite stations</source>
+    <translation variants="no">Favourite stations</translation>
+    <extra-loc-layout_id>qtl_toolbar_tiny_2</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>button</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_weather_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Weather</source>
+    <translation variants="no">Weather</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_1_2">
+    <comment>Two row list item first row. Displays artist and song name. Only in landscape. %1 is the artist&apos;s name and %2 is the song name.</comment>        
+    <source>%1 - %2</source>
+    <translation variants="no">%1 - %2</translation>
+    <extra-loc-layout_id>qtl_list_pri2_graphic_add</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_03</extra-loc-viewid>
+    <extra-loc-positionid>dblist</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_personality_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Personality</source>
+    <translation variants="no">Personality</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_rhythm_and_blues_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Rhythm and blues</source>
+    <translation variants="no">Rhythm and blues</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_information_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Information</source>
+    <translation variants="no">Information</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_leisure">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Leisure</source>
+    <translation variants="no">Leisure</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_alarm_test">
+    <comment>Main view Information area item. Displayed if PTY is available. RDS Programme Type identifier for PTY code 30.</comment>        
+    <source>Alarm Test</source>
+    <translation variants="no">Alarm Test</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_current_affairs_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Current affairs</source>
+    <translation variants="no">Current affairs</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_childrens_programmes_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Children’s programmes</source>
+    <translation variants="no">Children’s programmes</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_button_recently_played_songs">
+    <comment>Button text. Opens the Recently played songs list view.</comment>        
+    <source>Recently played songs</source>
+    <translation variants="no">Recently played songs</translation>
+    <extra-loc-layout_id>qtl_toolbar_tiny_2</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_03</extra-loc-viewid>
+    <extra-loc-positionid>button</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_jazz_music">
+    <comment>Main view Information area item. Displayed if PTY is available. RDS Programme Type identifier for PTY code 24.</comment>        
+    <source>Jazz Music</source>
+    <translation variants="no">Jazz Music</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_soft">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Soft</source>
+    <translation variants="no">Soft</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_information">
+    <comment>Main view Information area item. Displayed if PTY is available. RDS Programme Type identifier for PTY code 3.</comment>        
+    <source>Information</source>
+    <translation variants="no">Information</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_alarm_test">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Alarm Test</source>
+    <translation variants="no">Alarm Test</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_rhythm_and_blues">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Rhythm and blues</source>
+    <translation variants="no">Rhythm and blues</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_subhead_favorite_stations">
+    <comment>Heading text for the Stations view&apos;s Favorite stations view</comment>        
+    <source>Favorite stations</source>
+    <translation variants="no">Favorite stations</translation>
+    <extra-loc-layout_id>qtl_groupbox_simple_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>subhead</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_unknown">
+    <comment>First row of the two row list item. Displayed only in portrait and only when the artist name is not available for the identified song.</comment>        
+    <source>(Unknown)</source>
+    <translation variants="no">(Unknown)</translation>
+    <extra-loc-layout_id>qtl_list_pri_large_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_03</extra-loc-viewid>
+    <extra-loc-positionid>dblist</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_common_menu_play_music">
+    <comment>Item specific menu item. Starts to play the station when selected. Not displayed if station is already playing.</comment>        
+    <source>Play</source>
+    <translation variants="no">Play</translation>
+    <extra-loc-layout_id>qtl_menu_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>common</extra-loc-viewid>
+    <extra-loc-positionid>menu</extra-loc-positionid>
+    <extra-loc-feature>co</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_easy_listening_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Easy Listening</source>
+    <translation variants="no">Easy Listening</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_adult_hits">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Adult hits</source>
+    <translation variants="no">Adult hits</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_play_history_is_empty">
+    <comment>Title of the info text in main pane if &quot;Recently played songs&quot; or &quot;Tagged songs&quot; list has no items. </comment>        
+    <source>(No songs)</source>
+    <translation variants="no">(No songs)</translation>
+    <extra-loc-layout_id>qtl_view_empty_title_pri</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_03</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_public_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Public</source>
+    <translation variants="no">Public</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_varied_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Varied</source>
+    <translation variants="no">Varied</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_menu_search_from_music_store">
+    <comment>Item specific menu item. Allows the user to search the song/artist from Nokia Music Store</comment>        
+    <source>Search from Ovi Music</source>
+    <translation variants="no">Search from Ovi Music</translation>
+    <extra-loc-layout_id>qtl_menu_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01, rad_03</extra-loc-viewid>
+    <extra-loc-positionid>menu</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_button_identify_song">
+    <comment>A button text in main view. Allows the user to identify the currently playing song. Launches Shazam application which does the actual song identification. Displayed if Shazam application is available in the device.</comment>        
+    <source>Identify song</source>
+    <translation variants="no">Identify song</translation>
+    <extra-loc-layout_id>txt_rad_button_stations</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>button</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_science_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Science</source>
+    <translation variants="no">Science</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_jazz_music_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Jazz Music</source>
+    <translation variants="no">Jazz Music</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_documentary">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Documentary</source>
+    <translation variants="no">Documentary</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_list_seeking">
+    <comment>Main pane Information area item. Displayed on the center of the area when searching for a strong signal station.</comment>        
+    <source>Seeking</source>
+    <translation variants="no">Seeking</translation>
+    <extra-loc-layout_id>txt_rad_info_connect_wired_headset</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_folk_music_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Folk Music</source>
+    <translation variants="no">Folk Music</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_list_l1_mhz_big">
+    <comment>Main pane information area item for the frequency. %L1 is the radio station&apos;s frequency. Displayed in big font. Displayed if station name is not available. Note that the &quot;Mhz&quot; text is displayed smaller than the actual frequency.</comment>        
+    <source>%L1 MHz</source>
+    <translation variants="no">%L1 MHz</translation>
+    <extra-loc-layout_id>txt_rad_list_l1_mhz_big</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>list</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_top_40">
+    <comment>Main view Information area item. Displayed if PTY is available. Used only in US region.</comment>        
+    <source>Top 40</source>
+    <translation variants="no">Top 40</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_news">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>News</source>
+    <translation variants="no">News</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_connect_wired_headset1">
+    <comment>Main pane Information area item. Displayed if an antenna is not connected and no internal antenna is available. </comment>        
+    <source>Connect wired headset.</source>
+    <translation variants="no">Connect wired headset.</translation>
+    <extra-loc-layout_id>txt_rad_info_connect_wired_headset</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_easy_listening">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Easy Listening</source>
+    <translation variants="no">Easy Listening</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_finance">
+    <comment>Main view Information area item. Displayed if PTY is available. RDS Programme Type identifier for PTY code 17.</comment>        
+    <source>Finance</source>
+    <translation variants="no">Finance</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_childrens_programmes">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Children’s programmes</source>
+    <translation variants="no">Children’s programmes</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_adult_hits_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Adult hits</source>
+    <translation variants="no">Adult hits</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_serious_classical_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Serious classical</source>
+    <translation variants="no">Serious classical</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_documentary">
+    <comment>Main view Information area item. Displayed if PTY is available. RDS Programme Type identifier for PTY code 29.</comment>        
+    <source>Documentary</source>
+    <translation variants="no">Documentary</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_college_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>College</source>
+    <translation variants="no">College</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_button_tag_song">
+    <comment>A button text in main view. Adds the currently playing song to the Tagged songs list.</comment>        
+    <source>Tag song</source>
+    <translation variants="no">Tag song</translation>
+    <extra-loc-layout_id>txt_rad_button_stations</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>button</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_connect_wired_headset">
+    <comment>Notification text which is displayed in home screen widget, when the headset antenna is not connected.</comment>        
+    <source>Connect wired headset.</source>
+    <translation variants="no">Connect wired headset.</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_fm_radio">
+    <comment>Text displayed in main view station information area (in place of station name) during the FM radio startup when the station information is waited to be loaded on the screen.</comment>        
+    <source>FM Radio</source>
+    <translation variants="no">FM Radio</translation>
+    <extra-loc-layout_id>txt_rad_info_fm_radio</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_light_classical">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Light classical</source>
+    <translation variants="no">Light classical</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_button_deactivate_loudspeaker">
+    <comment>A button text in main view. Displayed if volume is coming from the integrated loudspeaker. Activating the function routes audio to the headset.</comment>        
+    <source>Deactivate loudspeaker</source>
+    <translation variants="no">Deactivate loudspeaker</translation>
+    <extra-loc-layout_id>txt_rad_button_stations</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>button</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_religious_talk">
+    <comment>Main view Information area item. Displayed if PTY is available. Used only in US region.</comment>        
+    <source>Religious talk</source>
+    <translation variants="no">Religious talk</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_language_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Language</source>
+    <translation variants="no">Language</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_button_search_all_stations">
+    <comment>A button text in main view. Starts the automatic frequency scanning for seeking all the available local stations</comment>        
+    <source>Search all stations</source>
+    <translation variants="no">Search all stations</translation>
+    <extra-loc-layout_id>txt_rad_button_stations</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>button</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_travel">
+    <comment>Main view Information area item. Displayed if PTY is available. RDS Programme Type identifier for PTY code 22.</comment>        
+    <source>Travel</source>
+    <translation variants="no">Travel</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dpophead_connect_wired_headset">
+    <comment>Discreet popup notification text. Displayed in all other views but main view when headset antenna is removed.</comment>        
+    <source>Connect wired headset.</source>
+    <translation variants="no">Connect wired headset.</translation>
+    <extra-loc-layout_id>qtl_notifdialog_pri2_medium_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad</extra-loc-viewid>
+    <extra-loc-positionid>dpophead</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_phone_in">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Phone In</source>
+    <translation variants="no">Phone In</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_oldies_music">
+    <comment>Main view Information area item. Displayed if PTY is available. RDS Programme Type identifier for PTY code 27.</comment>        
+    <source>Oldies Music</source>
+    <translation variants="no">Oldies Music</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_menu_search_from_other_store">
+    <comment>Item specific menu item. Allows the user to search the song/artist from some other music store than Ovi music store (usually some operator store). %1 can be any name, e.g. &quot;Vodafone music&quot;, &quot;Amazon&quot; etc.</comment>        
+    <source>Search from %1</source>
+    <translation variants="no">Search from %1</translation>
+    <extra-loc-layout_id>qtl_menu_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01, rad_03</extra-loc-viewid>
+    <extra-loc-positionid>menu</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_public">
+    <comment>Main view Information area item. Displayed if PTY is available. Used only in US region.</comment>        
+    <source>Public</source>
+    <translation variants="no">Public</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_talk_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Talk</source>
+    <translation variants="no">Talk</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz">
+    <comment>First row of the the two row list item. %L1 is the frequency value of the station. Displayed only if the station does not have a name.</comment>        
+    <source>%L1 MHz</source>
+    <translation variants="no">%L1 MHz</translation>
+    <extra-loc-layout_id>qtl_list_pri_graphic_add</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_list_l1_mhz_small">
+    <comment>Main pane information area item for the frequency. %L1 is the radio station&apos;s frequency. Displayed in small font if station name IS available.</comment>        
+    <source>%L1 MHz</source>
+    <translation variants="no">%L1 MHz</translation>
+    <extra-loc-layout_id>txt_rad_list_l1_mhz_small</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>list</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_dblist_l1_mhz_val_country_music">
+    <comment>Second row on the Stations list item (PTY=Program type information). </comment>        
+    <source>Country Music</source>
+    <translation variants="no">Country Music</translation>
+    <extra-loc-layout_id>qtl_list_sec_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_val</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_remove_song_from_tagged_songs">
+    <comment>Dialog text displayed when user is about to remove a song from Favorite list in Favorite songs view.</comment>        
+    <source>Remove song from tagged songs?</source>
+    <translation variants="no">Remove song from tagged songs?</translation>
+    <extra-loc-layout_id>qtl_dialog_pri5</extra-loc-layout_id>    
+    <extra-loc-viewid>rad</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_classic_rock">
+    <comment>Main view Information area item. Displayed if PTY is available. Used only in US region.</comment>        
+    <source>Classic rock</source>
+    <translation variants="no">Classic rock</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_travel_hs">
+    <comment>Displayed in FM Radio home screen widget&apos;s information area.</comment>        
+    <source>Travel</source>
+    <translation variants="no">Travel</translation>
+    <extra-loc-layout_id>txt_rad_info_news_hs</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_05</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_common_opt_activate_loudspeaker">
+    <comment>Options list item. Switches the audio from handset or handsfree to loudspeaker. Only available if audio can be routed to the loudspeaker.</comment>        
+    <source>Activate loudspeaker</source>
+    <translation variants="no">Activate loudspeaker</translation>
+    <extra-loc-layout_id>qtl_menu_pri</extra-loc-layout_id>    
+    <extra-loc-viewid>common</extra-loc-viewid>
+    <extra-loc-positionid>opt</extra-loc-positionid>
+    <extra-loc-feature>co</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_subhead_all_stations">
+    <comment>Heading text for the Stations view&apos;s Play history view</comment>        
+    <source>All stations</source>
+    <translation variants="no">All stations</translation>
+    <extra-loc-layout_id>qtl_groupbox_simple_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_02</extra-loc-viewid>
+    <extra-loc-positionid>subhead</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_rad_info_folk_music">
+    <comment>Main view Information area item. Displayed if PTY is available. RDS Programme Type identifier for PTY code 28.</comment>        
+    <source>Folk Music</source>
+    <translation variants="no">Folk Music</translation>
+    <extra-loc-layout_id>txt_rad_info_news</extra-loc-layout_id>    
+    <extra-loc-viewid>rad_01</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>ra</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+</context>
+</TS>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioapplication/resources/service_conf.xml	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<service>
+  <name>com.nokia.services.Radio</name>
+  <filepath>No path</filepath>
+  <description>Radio services</description>
+  <interface>
+     <name>IRadioControl</name>
+     <version>1.0</version>
+     <description>Interface to control radio playback</description>
+   </interface>
+  <interface>
+     <name>IRadioMonitor</name>
+     <version>1.0</version>
+     <description>Interface to monitor radio status changes</description>
+   </interface>
+</service>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioapplication/src/main.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,50 @@
+/*
+* 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:
+*
+*/
+
+// System includes
+#include <HbTranslator>
+
+// User includes
+#include "radioapplication.h"
+#include "radiologger.h"
+
+// Constants
+#ifdef BUILD_WIN32
+    const char* TRANSLATIONS_FOLDER = "";
+#else
+    const char* TRANSLATIONS_FOLDER = "/resource/qt/translations/";
+#endif // BUILD_WIN32
+
+/*!
+ * Runs the application
+ */
+int main( int argc, char* argv[] )
+{
+    INSTALL_MESSAGE_HANDLER // Installs the file tracer if enabled
+
+    LOG_TIMESTAMP( "Tesla started" );
+
+    RadioApplication app( argc, argv );
+
+    HbTranslator translator( TRANSLATIONS_FOLDER, "fmradio" ); // TODO: Rename exe to fmradio.exe to get rid of this
+
+    const int returnValue = app.exec();
+
+    UNINSTALL_MESSAGE_HANDLER // Uninstalls the file tracer
+
+    return returnValue;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioapplication/src/radioapplication.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,101 @@
+/*
+* 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:
+*
+*/
+
+// System includes
+#include <QTimer>
+#include <HbDeviceMessageBox>
+
+// User includes
+#include "radioapplication.h"
+#include "radiowindow.h"
+#include "radiouiengine.h"
+#include "radio_global.h"
+#include "radiologger.h"
+
+#ifdef BUILD_WIN32
+#   include "testwindow_win32.h"
+#   define CREATE_WIN32_TEST_WINDOW \
+        mWin32Window.reset( new Win32Window() ); \
+        mMainWindow->setParent( mWin32Window.data() ); \
+        mWin32Window->addHbWindow( mMainWindow.data() ); \
+        mWin32Window->show();
+#   define INIT_WIN32_TEST_WINDOW \
+        mWin32Window->init();
+#else
+#   define CREATE_WIN32_TEST_WINDOW
+#   define INIT_WIN32_TEST_WINDOW
+#endif // BUILD_WIN32
+
+/*!
+ * Constructor
+ */
+RadioApplication::RadioApplication( int &argc, char *argv[] ) :
+    HbApplication( argc, argv )
+{
+    // Initializes the radio engine utils if UI logs are entered into the engine log
+    INIT_COMBINED_LOGGER
+
+    LOG_TIMESTAMP( "Start radio" );
+    setApplicationName( hbTrId( "txt_rad_title_fm_radio" ) );
+
+    QTimer::singleShot( 0, this, SLOT(init()) );
+}
+
+/*!
+ *
+ */
+RadioApplication::~RadioApplication()
+{
+    // Destructor needs to be defined. See explanation from RadioEngineWrapperPrivate destructor.
+    // Releases the radio engine utils if it was initialized in the beginning
+    RELEASE_COMBINED_LOGGER
+}
+
+/*!
+ *Private slot
+ *
+ */
+void RadioApplication::init()
+{
+    bool okToStart = !RadioUiEngine::isOfflineProfile();
+
+    if ( !okToStart ) {
+        HbDeviceMessageBox box( hbTrId( "txt_rad_info_activate_radio_in_offline_mode" ), HbMessageBox::MessageTypeQuestion );
+        box.setTimeout( HbPopup::NoTimeout );
+        box.exec();
+        okToStart = box.isAcceptAction( box.triggeredAction() );
+    }
+
+    if ( okToStart ) {
+
+        // MainWindow needs to be alive to be able to show the offline query dialog.
+        // The window is only constructed half-way at this point because we may need to shut down if
+        // offline usage is not allowed
+        mMainWindow.reset( new RadioWindow() );
+
+        CREATE_WIN32_TEST_WINDOW
+
+        INIT_WIN32_TEST_WINDOW
+
+        // Construct the real views
+        mMainWindow->init();
+
+        mMainWindow->show();
+    } else {
+        quit();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioapplication/src/testwindow_win32.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,347 @@
+/*
+* 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:
+*
+*/
+
+// System includes
+#include <QPushButton>
+#include <QGridLayout>
+#include <QVBoxLayout>
+#include <HbMainWindow>
+#include <QTimer>
+#include <QMessageBox>
+#include <QComboBox>
+#include <QLocalSocket>
+#include <QDir>
+#include <QStringListModel>
+#include <QSettings>
+#include <HbInstance>
+#include <QLabel>
+
+// User includes
+#include "testwindow_win32.h"
+#include "radioapplication.h"
+#include "radiologger.h"
+#include "radio_global.h"
+#include "radioenginewrapper_win32_p.h"
+
+const int KWindowWidth = 360;
+const int KWindowHeight = 640;
+const int KToolbarHeight = 140;
+
+const QString KBtnDisconnectHeadset = "Disconnect Headset";
+const QString KBtnConnectHeadset = "Connect Headset";
+
+const QString KBtnGoOffline = "Go Offline";
+const QString KBtnGoOnline = "Go Online";
+
+struct Song
+{
+    const char* mArtist;
+    const char* mTitle;
+};
+
+const Song KRecognizedSongs[] = {
+    { "Red Hot Chili Peppers", "Under The Bridge" },
+    { "Queens Of The Stone Age", "No One Knows" },
+    { "The Presidents of the United States of America", "Dune Buggy" },
+    { "System of a Down", "Aerials" },
+    { "The White Stripes", "Seven Nation Army" },
+    { "Alice In Chains", "When The Sun Rose Again" },
+    { "Bullet For My Valentine", "Tears Don't Fall" }
+};
+const int KSongsCount = sizeof( KRecognizedSongs ) / sizeof( KRecognizedSongs[0] );
+
+/*!
+ *
+ */
+Win32Window::Win32Window() :
+    QWidget( 0 ),
+    mOrientationButton( new QPushButton( "Change Orientation", this ) ),
+    mVolUpButton( new QPushButton( "Volume Up", this ) ),
+    mVolDownButton( new QPushButton( "Volume Down", this ) ),
+    mAddSongButton( new QPushButton( "Add Song", this ) ),
+    mClearSongButton( new QPushButton( "Clear Song", this ) ),
+    mHeadsetButton( new QPushButton( KBtnDisconnectHeadset, this ) ),
+    mHeadsetConnected( true ),
+    mOfflineButton( new QPushButton( KBtnGoOffline, this ) ),
+    mThemeBox( new QComboBox( this ) ),
+    mToolbarLayout( 0 ),
+    mVolume( 5 ),
+    mRadioWindow( 0 ),
+    mOrientation( Qt::Vertical ),
+    mSongIndex( 0 )
+{
+    mThemeBox->setEditable( false );
+    initThemes();    
+
+    connectAndTest( mOrientationButton, SIGNAL(clicked()), this, SLOT(changeOrientation()) );
+    connectAndTest( mVolUpButton, SIGNAL(clicked()), this, SLOT(volumeUp()) );
+    connectAndTest( mVolDownButton, SIGNAL(clicked()), this, SLOT(volumeDown()) );
+    connectAndTest( mHeadsetButton, SIGNAL(clicked()), this, SLOT(toggleHeadsetStatus()) );
+    connectAndTest( mAddSongButton, SIGNAL(clicked()), this, SLOT(addSong()) );
+    connectAndTest( mClearSongButton, SIGNAL(clicked()), this, SLOT(clearSong()) );
+    connectAndTest( mOfflineButton, SIGNAL(clicked()), this, SLOT(toggleOffline()) );
+    connectAndTest( mThemeBox, SIGNAL(activated(QString)), this, SLOT(changeTheme(QString)) );
+
+    QTimer::singleShot( 0, this, SLOT(updateWindowSize()) );
+}
+
+/*!
+ *
+ */
+Win32Window::~Win32Window()
+{
+}
+
+/*!
+ *
+ */
+void Win32Window::addHbWindow( HbMainWindow* radioWindow )
+{
+    mRadioWindow = radioWindow;
+    mOrientation = mRadioWindow->orientation();
+    updateWindowSize();
+
+    QVBoxLayout* layout = new QVBoxLayout( this );
+    layout->setMargin( 5 );
+    layout->setSpacing( 5 );
+
+    mToolbarLayout = new QGridLayout( this );
+    mToolbarLayout->setHorizontalSpacing( 5 );
+    mToolbarLayout->setVerticalSpacing( 5 );
+
+    mToolbarLayout->addWidget( mOrientationButton, 0, 0 );
+    mToolbarLayout->addWidget( mVolUpButton, 0, 1 );
+    mToolbarLayout->addWidget( mVolDownButton, 1, 1 );
+    mToolbarLayout->addWidget( mHeadsetButton, 1, 0 );
+    mToolbarLayout->addWidget( mAddSongButton, 2, 0 );
+    mToolbarLayout->addWidget( mClearSongButton, 2, 1 );
+    mToolbarLayout->addWidget( mOfflineButton, 3, 0 );
+
+    QGridLayout* themeLayout = new QGridLayout( this );
+    themeLayout->addWidget( new QLabel( "Theme:", this ), 0, 0 );
+    themeLayout->addWidget( mThemeBox, 0, 1 );
+    themeLayout->setColumnStretch( 1, 2 );
+
+    mToolbarLayout->addLayout( themeLayout, 3, 1 );
+    mToolbarLayout->setColumnStretch( 0, 1 );
+    mToolbarLayout->setColumnStretch( 1, 1 );
+
+    layout->addItem( mToolbarLayout );
+    layout->addWidget( radioWindow );
+
+    setLayout( layout );
+}
+
+/*!
+ *
+ */
+void Win32Window::init()
+{
+    RadioEngineWrapperPrivate* wrapper = RadioEngineWrapperPrivate::instance();
+    if ( wrapper ) {
+        QString error = wrapper->dataParsingError();
+        if ( !error.isEmpty() ) {
+            QMessageBox msg( QMessageBox::Warning, "Unable to parse radio settings", error, QMessageBox::Ok );
+            msg.exec();
+        }
+
+        if ( wrapper->isOffline() ) {
+            mOfflineButton->setText( KBtnGoOnline );
+        }
+    }
+    updateWindowSize();
+}
+
+/*!
+ * Private slot
+ */
+void Win32Window::changeOrientation()
+{
+    if ( mOrientation == Qt::Horizontal ) {
+        mOrientation = Qt::Vertical;
+    } else {
+        mOrientation = Qt::Horizontal;
+    }
+
+    mRadioWindow->setOrientation( mOrientation );
+    updateWindowSize();
+}
+
+/*!
+ * Private slot
+ */
+void Win32Window::volumeUp()
+{
+    if ( ++mVolume > KMaximumVolumeLevel ) {
+        mVolume = KMaximumVolumeLevel;
+    }
+    RadioEngineWrapperPrivate::instance()->setVolume( mVolume );
+}
+
+/*!
+ * Private slot
+ */
+void Win32Window::volumeDown()
+{
+    if ( --mVolume < 0 ) {
+        mVolume = 0;
+    }
+    RadioEngineWrapperPrivate::instance()->setVolume( mVolume );
+}
+
+/*!
+ * Private slot
+ */
+void Win32Window::toggleHeadsetStatus()
+{
+    mHeadsetConnected = !mHeadsetConnected;
+    if ( mHeadsetConnected ) {
+        mHeadsetButton->setText( KBtnDisconnectHeadset );
+    } else {
+        mHeadsetButton->setText( KBtnConnectHeadset );
+    }
+    RadioEngineWrapperPrivate::instance()->setHeadsetStatus( mHeadsetConnected );
+}
+
+/*!
+ * Private slot
+ */
+void Win32Window::updateWindowSize()
+{
+    if ( mOrientation == Qt::Horizontal ) {
+        resize( KWindowHeight, KWindowWidth + KToolbarHeight );
+    } else {
+        resize( KWindowWidth, KWindowHeight + KToolbarHeight );
+    }
+}
+
+/*!
+ * Private slot
+ */
+void Win32Window::addSong()
+{
+    Song song = KRecognizedSongs[mSongIndex++];
+    mSongIndex %= KSongsCount;
+
+    RadioEngineWrapperPrivate::instance()->addSong( song.mArtist, song.mTitle );
+}
+
+/*!
+ * Private slot
+ */
+void Win32Window::clearSong()
+{
+    RadioEngineWrapperPrivate::instance()->clearSong();
+}
+
+/*!
+ * Private slot
+ */
+void Win32Window::toggleOffline()
+{
+    bool offline = !RadioEngineWrapperPrivate::instance()->isOffline();
+    RadioEngineWrapperPrivate::instance()->setOffline( offline );
+    if ( offline ) {
+        mOfflineButton->setText( KBtnGoOnline );
+    } else {
+        mOfflineButton->setText( KBtnGoOffline );
+    }
+}
+
+/*!
+ * Private slot
+ */
+void Win32Window::changeTheme( const QString& theme )
+{
+    QLocalSocket socket;
+    socket.connectToServer( "hbthemeserver" );
+    if ( socket.waitForConnected( 3000 ) ) {
+        QByteArray outputByteArray;
+        QDataStream outputDataStream( &outputByteArray, QIODevice::WriteOnly );
+        outputDataStream << 4; // EThemeSelection from HbThemeServerRequest in hbthemecommon_p.h
+        outputDataStream << theme;
+        socket.write( outputByteArray );
+        socket.flush();
+    }
+}
+
+/*!
+ *
+ */
+void Win32Window::initThemes()
+{
+    QStringList themeList;
+    foreach ( const QString& themeRootPath, themeRootPaths() ) {
+        QDir dir( themeRootPath ) ;
+        QStringList list = dir.entryList( QDir::AllDirs | QDir::NoDotAndDotDot, QDir::Name );
+
+        if ( list.contains( "themes", Qt::CaseSensitive ) ) {
+            QDir root = themeRootPath;
+            dir.setPath( root.path() + "/themes/icons/" );
+            QStringList iconthemeslist = dir.entryList( QDir::AllDirs | QDir::NoDotAndDotDot, QDir::Name );
+            foreach ( QString themefolder, iconthemeslist ) {
+                QDir iconThemePath( root.path() + "/themes/icons/" + themefolder );
+                if ( iconThemePath.exists( "index.theme" ) ) {
+                    QSettings iniSetting( iconThemePath.path() + "/index.theme", QSettings::IniFormat );
+                    iniSetting.beginGroup( "Icon Theme" );
+                    QString hidden = iniSetting.value( "Hidden" ).toString();
+                    QString name = iniSetting.value( "Name" ).toString();
+                    iniSetting.endGroup();
+                    if ( (hidden == "true") || ( hidden == "" ) || ( name != themefolder ) ) {
+                        iconthemeslist.removeOne( themefolder );
+                    }
+                }
+                else {
+                     iconthemeslist.removeOne( themefolder );
+                }
+
+            }
+
+            themeList.append( iconthemeslist );
+        }
+    }
+
+    if ( themeList.count() == 0 ) {
+        themeList.insert( 0, "hbdefault" ); //adding one default entry
+        mThemeBox->setEnabled( false );
+    }
+
+    mThemeBox->setModel( new QStringListModel( themeList, mThemeBox ) );
+
+    for ( int i = 0; i < themeList.count(); ++i ) {
+        QString theme = themeList.at( i );
+        if ( theme == HbInstance::instance()->theme()->name() ) {
+            mThemeBox->setCurrentIndex( i );
+        }
+    }
+}
+
+/*!
+ *
+ */
+QStringList Win32Window::themeRootPaths()
+{
+    QStringList rootDirs;
+    QString envDir = qgetenv( "HB_THEMES_DIR" );
+    if ( !envDir.isEmpty() ) {
+        rootDirs << envDir;
+    }
+
+    rootDirs << HB_RESOURCES_DIR;
+
+    return rootDirs;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioenginewrapper/inc/cradioenginehandler.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,247 @@
+/*
+* 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 _CRADIOENGINEHANDLER_H_
+#define _CRADIOENGINEHANDLER_H_
+
+// System includes
+#include <e32base.h>
+
+#include <mw/ProfileEngineSDKCRKeys.h>
+
+// User includes
+#include "radio_global.h"
+#include "mradioengineinitializer.h"
+
+// Forward declarations
+class CRadioEngine;
+class MRadioScanObserver;
+class MRadioRdsDataObserver;
+class CRadioRepositoryManager;
+class MRadioEngineHandlerObserver;
+class MRadioApplicationSettings;
+
+// Class declaration
+class CRadioEngineHandler : public CBase
+                          , public MRadioEngineInitializer
+    {
+public:
+
+    CRadioEngineHandler( MRadioEngineHandlerObserver& aObserver );
+
+    ~CRadioEngineHandler();
+
+    void ConstructL();
+
+    /**
+     * Sets the rds data observer
+     */
+    void SetRdsObserver( MRadioRdsDataObserver* aObserver );
+
+    /**
+     * Returns the radio status
+     * @return ETrue = radio is on, EFalse = radio is off
+     */
+    TBool IsRadioOn();
+
+    /**
+     * Tune to the specified frequency
+     * @param aFrequency - frequency to lock onto.
+     */
+    void Tune( TUint aFrequency );
+
+    /**
+     * Tune to the specified frequency after a delay
+     * @param aFrequency - frequency to lock onto.
+     */
+    void TuneWithDelay( TUint aFrequency );
+
+    /**
+     * Sets the audio mute state
+     * @param aMuted - flag to determine whether mute should be turned on or off
+     */
+    void SetMuted( const TBool aMuted );
+
+    /**
+     * Gets the audio mute state
+     * @return ETrue or EFalse to indicate whether mute is currently on.
+     */
+    TBool IsMuted() const;
+
+    /**
+     * Sets the volume level of the FM radio
+     * @param aVolume - the volume to be used.
+     */
+    void SetVolume( TInt aVolume );
+
+    /**
+     * Gets the volumelevel.
+     * @return the current volume
+     */
+    TInt Volume() const;
+
+    /**
+     * Gets the max volumelevel.
+     * @return the max volume
+     */
+    TInt MaxVolume() const;
+
+    /**
+     * Increases the volume by one increment
+     */
+    void IncreaseVolume();
+
+    /**
+     * Decreases the volume by one increment
+     */
+    void DecreaseVolume();
+
+    /**
+     * Checks if the antenna is attached
+     * @return ETrue or EFalse to indicate whether antenna is currently attached.
+     */
+    TBool IsAntennaAttached() const;
+
+    /**
+     * Retrieves the current frequency.
+     * @return the frequency in hertz
+     */
+    TUint TunedFrequency() const;
+
+    /**
+     * Returns the minimum allowed frequency in the current region
+     */
+    TUint MinFrequency() const;
+
+    /**
+     * Returns the maximum allowed frequency in the current region
+     */
+    TUint MaxFrequency() const;
+
+    /**
+     * Checks if the given frequency is valid in the current region
+     */
+    TBool IsFrequencyValid( TUint aFrequency ) const;
+
+    /**
+     * Scan up to the next available frequency.
+     */
+    void Seek( Seeking::Direction direction );
+
+    /**
+     * Cancel previously requested scan.
+     */
+    void CancelSeek();
+
+    /**
+     * Returns the engine seeking state
+     */
+    Seeking::State SeekingState() const;
+
+    void StartScan( MRadioScanObserver& aObserver );
+
+    void StopScan( TInt aError = KErrCancel );
+
+    /**
+     * Rreturn step size for tuning.
+     * @return step size
+     */
+    TUint32 FrequencyStepSize() const;
+
+    /**
+     * Determine current region
+     * @return fmradio region. In case of error, returns EFMRadioRegionNone.
+     */
+    RadioRegion::Region Region() const;
+
+    /**
+     * Sets whether or not audio should be routed to loudspeaker
+     * @param aLoudspeaker ETrue if loudspeaker should be used, EFalse if not
+     */
+    void SetAudioRouteToLoudspeaker( TBool aLoudspeaker );
+
+    /**
+     * Checks if audio is routed to loudspeaker
+     * @return ETrue if loudspeaker is used, EFalse if headset is used
+     */
+    TBool IsAudioRoutedToLoudspeaker() const;
+
+    /**
+     * Returns ar reference to the publish & subscribe handler
+     */
+    CRadioPubSub& PubSub();
+
+    /**
+     * Returns the repository manager.
+     *
+     * @return  The repository manager.
+     */
+    CRadioRepositoryManager& Repository() const;
+
+    MRadioApplicationSettings& ApplicationSettings() const;
+
+private:
+
+// from base class MRadioEngineInitializer
+
+    CRadioAudioRouter* InitAudioRouterL();
+    CRadioSystemEventCollector* InitSystemEventCollectorL();
+    CRadioSettings* InitSettingsL();
+    CRadioPubSub* InitPubSubL();
+
+// New functions
+
+    /**
+     * Static callback function to be used by the tune delay timer
+     * @param aSelf Pointer to this
+     * @return not used
+     */
+    static TInt TuneDelayCallback( TAny* aSelf );
+
+private: // data
+
+    /**
+     * Radio engine holder
+     * Own.
+     */
+    CRadioEngine*                   iEngine;
+
+    /**
+     * Radio handler observer
+     * Not own.
+     */
+    MRadioEngineHandlerObserver&    iObserver;
+
+    /**
+     * Frequency used by delayed tuning
+     */
+    TUint                           iFrequency;
+
+    /**
+     * Timer used for delayed tuning
+     * Own.
+     */
+    CPeriodic*                      iDelayTimer;
+
+    /**
+     * Selected radio region
+     */
+    RadioRegion::Region             iRegion;
+
+    };
+
+#endif //_CRADIOENGINEHANDLER_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioenginewrapper/inc/mradioenginehandlerobserver.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef _MRADIOENGINEHANDLEROBSERVER_H_
+#define _MRADIOENGINEHANDLEROBSERVER_H_
+
+// User includes
+#include "mradioengineobserver.h"
+#include "mradioaudioroutingobserver.h"
+#include "mradiosystemeventobserver.h"
+#include "mradiorepositoryentityobserver.h"
+
+// Class declaration
+NONSHARABLE_CLASS( MRadioEngineHandlerObserver ) : public MRadioEngineObserver
+                                                 , public MRadioAudioRoutingObserver
+                                                 , public MRadioSystemEventObserver
+                                                 , public MRadioRepositoryEntityObserver
+{
+public:
+
+};
+
+#endif // _MRADIOENGINEHANDLEROBSERVER_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioenginewrapper/inc/radiocontroleventlistener.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef RADIOCONTROLEVENTLISTENER_H_
+#define RADIOCONTROLEVENTLISTENER_H_
+
+// System includes
+#include <QtGlobal>
+#include <QScopedPointer>
+
+// User includes
+#include "mradiocontroleventobserver.h"
+
+// Forward declarations
+class RadioEngineWrapperPrivate;
+class CRadioRemConTarget;
+
+class RadioControlEventListener : public MRadioControlEventObserver
+{
+    Q_DISABLE_COPY( RadioControlEventListener )
+
+public:
+
+    explicit RadioControlEventListener( RadioEngineWrapperPrivate& engine );
+
+    ~RadioControlEventListener();
+
+    void init();
+
+private:
+
+// from base class MRadioControlEventObserver
+
+    void StepToChannelL( RadioEngine::TRadioTuneDirection aDirection );
+    void SetChannelL( TInt aChannelId );
+    void SeekL( RadioEngine::TRadioTuneDirection aDirection );
+    void StepToFrequencyL( RadioEngine::TRadioTuneDirection aDirection );
+    void SetFrequencyL( TUint32 aFreq );
+    void AdjustVolumeL( RadioEngine::TRadioVolumeSetDirection aDirection );
+    void MuteL( TBool aMute );
+    void PlayL( TBool aDownPressed );
+    void PauseL( TBool aDownPressed );
+    void PausePlayL( TBool aDownPressed );
+    void StopL( TBool aDownPressed );
+    void ForwardL( TBool aDownPressed );
+    void FastForwardL( TBool aDownPressed );
+    void BackwardL( TBool aDownPressed );
+    void RewindL( TBool aDownPressed );
+    void ChannelUpL( TBool aDownPressed );
+    void ChannelDownL( TBool aDownPressed );
+    void VolumeUpL( TBool aDownPressed );
+    void VolumeDownL( TBool aDownPressed );
+    void ChangeViewL( TUid aViewId, TBool aForceChange );
+    void SetAudioRouteL( RadioEngine::TRadioAudioRoute aRoute );
+    void AnswerEndCallL();
+
+private: // data
+
+    RadioEngineWrapperPrivate&          mEngine;
+
+    QScopedPointer<CRadioRemConTarget>  mRemCon;
+
+};
+
+#endif // RADIOCONTROLEVENTLISTENER_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioenginewrapper/inc/radioenginewrapper.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,103 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef RADIOENGINEWRAPPER_H
+#define RADIOENGINEWRAPPER_H
+
+// System includes
+
+// User includes
+#include "radiowrapperexport.h"
+#include "radio_global.h"
+
+// Forward declarations
+class RadioEngineWrapperPrivate;
+class RadioSettingsIf;
+class RadioStationHandlerIf;
+class RadioEngineWrapperObserver;
+
+// Class declaration
+class WRAPPER_DLL_EXPORT RadioEngineWrapper
+{
+    Q_DECLARE_PRIVATE_D( d_ptr, RadioEngineWrapper )
+    Q_DISABLE_COPY( RadioEngineWrapper )
+
+public:
+
+    /**
+     * Constructor and destructor
+     */
+    RadioEngineWrapper( RadioStationHandlerIf& stationHandler );
+    ~RadioEngineWrapper();
+
+    void addObserver( RadioEngineWrapperObserver* observer );
+    void removeObserver( RadioEngineWrapperObserver* observer );
+
+    /**
+     * Checks if the radio engine has been constructed properly
+     */
+    bool isEngineConstructed();
+
+    /**
+     * Getters for things owned by the engine
+     */
+    RadioSettingsIf& settings();
+
+    /**
+     * Getters for region and other region dependent settings
+     */
+    RadioRegion::Region region() const;
+    uint minFrequency() const;
+    uint maxFrequency() const;
+    uint frequencyStepSize() const;
+    bool isFrequencyValid( uint frequency );
+
+    /**
+     * Getters for current radio status
+     */
+    bool isRadioOn() const;
+    uint currentFrequency() const;
+    bool isMuted() const;
+    bool isAntennaAttached() const;
+    bool isUsingLoudspeaker() const;
+
+    /**
+     * Functions to tune to given frequency or preset
+     */
+    void tuneFrequency( uint frequency, const int reason = TuneReason::Unspecified );
+    void tuneWithDelay( uint frequency, const int reason = TuneReason::Unspecified );
+
+    /*!
+     * Audio update command functions for the engine
+     */
+    void setVolume( int volume );
+    void setMute( bool muted );
+    void toggleAudioRoute();
+
+    void startSeeking( Seeking::Direction direction, const int reason = TuneReason::Unspecified );
+    void cancelSeeking();
+
+private: // data
+
+    /**
+     * Unmodifiable pointer to the private implementation
+     */
+    RadioEngineWrapperPrivate* const d_ptr;
+
+};
+
+#endif // RADIOENGINEWRAPPER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioenginewrapper/inc/radioenginewrapper_p.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,175 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef RADIOENGINEWRAPPER_P_H
+#define RADIOENGINEWRAPPER_P_H
+
+// System includes
+#include <e32std.h>
+#include <QScopedPointer>
+#include <QList>
+
+// User includes
+#include "radioenginewrapper.h"
+#include "mradioenginehandlerobserver.h"
+
+// Forward declarations
+class CRadioEngineHandler;
+class RadioControlEventListener;
+class RadioRdsListener;
+class RadioSettingsIf;
+class RadioSettings;
+class RadioStationHandlerIf;
+class RadioEngineWrapperObserver;
+
+typedef QList<RadioEngineWrapperObserver*> ObserverList;
+
+// Constants
+
+#define RUN_NOTIFY_LOOP( list, func ) \
+        foreach( RadioEngineWrapperObserver* observer, list ) { \
+            observer->func; \
+        }
+
+// Class declaration
+class RadioEngineWrapperPrivate : public MRadioEngineHandlerObserver
+{
+    Q_DECLARE_PUBLIC( RadioEngineWrapper )
+    Q_DISABLE_COPY( RadioEngineWrapperPrivate )
+
+    friend class RadioFrequencyScanningHandler;
+
+public:
+
+    RadioEngineWrapperPrivate( RadioEngineWrapper* wrapper,
+                               RadioStationHandlerIf& stationHandler );
+
+    virtual ~RadioEngineWrapperPrivate();
+
+    /**
+     * Initialization and startup
+     */
+    void init();
+    bool isEngineConstructed();
+
+    /**
+     * Returns the radio settings
+     */
+    RadioSettingsIf& settings();
+
+    /**
+    * Getter for CRadioEngineHandler instance.
+    * Returns reference to the CRadioEngineHandler
+    */
+    CRadioEngineHandler& RadioEnginehandler();
+
+    /**
+     * Functions called from slots to tune to given frequency or preset
+     */
+    void tuneFrequency( uint frequency, const int reason );
+    void tuneWithDelay( uint frequency, const int reason );
+
+    ObserverList& observers();
+
+    void startSeeking( Seeking::Direction direction, const int reason = TuneReason::Unspecified );
+
+private:
+
+// from base class MRadioEngineObserver
+
+    void PowerEventL( TBool aPowerState, TInt aError );
+    void FrequencyEventL( TUint32 aFrequency, RadioEngine::TRadioFrequencyEventReason aReason, TInt aError );
+    void VolumeEventL( TInt aVolume, TInt aError );
+    void MuteEventL( TBool aMuteState, TInt aError );
+    void AudioModeEventL( TInt aAudioMode, TInt aError );
+    void AntennaEventL( TBool aAntennaAttached, TInt aError );
+    void AudioRoutingEventL( TInt aAudioDestination, TInt aError );
+    void SeekingEventL( TInt aSeekingState, TInt aError );
+    void RegionEventL( TInt aRegion, TInt aError );
+    void FmTransmitterEventL( TBool /*aActive*/ ) {}
+
+// from base class MRadioAudioRoutingObserver
+
+    void AudioRouteChangedL( RadioEngine::TRadioAudioRoute aRoute );
+
+// from base class MRadioSystemEventObserver
+
+    void HandleSystemEventL( TRadioSystemEventType aEventType );
+
+// from base class MRadioRepositoryEntityObserver
+
+    void HandleRepositoryValueChangeL( const TUid& aUid, TUint32 aKey, TInt aValue, TInt aError );
+    void HandleRepositoryValueChangeL( const TUid& /*aUid*/, TUint32 /*aKey*/, const TReal& /*aValue*/, TInt /*aError*/ ) {}
+    void HandleRepositoryValueChangeL( const TUid& /*aUid*/, TUint32 /*aKey*/, const TDesC8& /*aValue*/, TInt /*aError*/ ) {}
+    void HandleRepositoryValueChangeL( const TUid& /*aUid*/, TUint32 /*aKey*/, const TDesC16& /*aValue*/, TInt /*aError*/ ) {}
+
+private: // data
+
+    /**
+     * Pointer to the public class
+     * Not own.
+     */
+    RadioEngineWrapper*                             q_ptr;
+
+    /**
+     * Map of radio stations read from the radio engine
+     * Own.
+     */
+    RadioStationHandlerIf&                          mStationHandler;
+
+    /**
+     * Reference to the wrapper observer
+     */
+    ObserverList                                    mObservers;
+
+    /**
+     * Radio settings handler
+     * Own.
+     */
+    QScopedPointer<RadioSettings>                   mSettings;
+
+    /**
+     * Radio engine handler.
+     * Own.
+     */
+    QScopedPointer<CRadioEngineHandler>             mEngineHandler;
+
+    /**
+     * RemCon listener.
+     * Own.
+     */
+    QScopedPointer<RadioControlEventListener>       mControlEventListener;
+
+    /**
+     * Rds listener
+     * Own.
+     */
+    QScopedPointer<RadioRdsListener>                mRdsListener;
+
+    /**
+     * Reason for the tune event. Can be FrequencyStrip, Carousel or station scanner
+     */
+    int                                             mTuneReason;
+
+    /**
+     * Flag to indicate whether or not audio should be routed to loudspeaker
+     */
+    bool                                            mUseLoudspeaker;
+
+};
+
+#endif // RADIOENGINEWRAPPER_P_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioenginewrapper/inc/radioenginewrapper_win32_p.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,182 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef RADIOENGINEWRAPPER_P_H
+#define RADIOENGINEWRAPPER_P_H
+
+// System includes
+#include <QObject>
+#include <QScopedPointer>
+
+// User includes
+#include "radioenginewrapper.h"
+
+// Forward declarations
+class RadioControlEventListener;
+class RadioRdsListener;
+class RadioSettings;
+class RadioSettingsIf;
+class RadioFrequencyScanningHandler;
+class RadioStationHandlerIf;
+class RadioEngineWrapperObserver;
+class T_RadioDataParser;
+class QSettings;
+class QTimer;
+
+typedef QList<RadioEngineWrapperObserver*> ObserverList;
+
+#define RUN_NOTIFY_LOOP( list, func ) \
+        foreach( RadioEngineWrapperObserver* observer, list ) { \
+            observer->func; \
+        }
+
+// Class declaration
+class WRAPPER_DLL_EXPORT RadioEngineWrapperPrivate : public QObject
+{
+    Q_OBJECT
+    Q_DECLARE_PUBLIC( RadioEngineWrapper )
+    Q_DISABLE_COPY( RadioEngineWrapperPrivate )
+
+    friend class RadioFrequencyScanningHandler;
+
+public:
+
+    RadioEngineWrapperPrivate( RadioEngineWrapper* wrapper,
+                               RadioStationHandlerIf& stationHandler );
+
+    ~RadioEngineWrapperPrivate();
+
+    static RadioEngineWrapperPrivate* instance();
+
+    /**
+     * Initialization and startup
+     */
+    void init();
+    bool isEngineConstructed();
+
+    /**
+     * Returns the radio settings
+     */
+    RadioSettingsIf& settings();
+
+    /**
+     * Functions called from slots to tune to given frequency or preset
+     */
+    void tuneFrequency( uint frequency, const int reason );
+    void tuneWithDelay( uint frequency, const int reason );
+
+    ObserverList& observers();
+
+    void startSeeking( Seeking::Direction direction, const int reason );
+    void cancelSeeking();
+
+    void toggleAudioRoute();
+
+// Functions used by the win32 test window
+
+    QString dataParsingError() const;
+
+    void setHeadsetStatus( bool connected );
+
+    void setVolume( int volume );
+
+    void addSong( const QString& artist, const QString& title );
+
+    void clearSong();
+
+    bool isOffline() const;
+    void setOffline( bool offline );
+
+private slots:
+
+    void frequencyEvent();
+    void addSongTags();
+
+private:
+
+// New functions
+
+    void parseData();
+
+private: // data
+
+    /**
+     * Pointer to the public class
+     * Not own.
+     */
+    RadioEngineWrapper*                             q_ptr;
+
+    /**
+     * Map of radio stations read from the radio engine
+     * Own.
+     */
+    RadioStationHandlerIf&                          mStationHandler;
+
+    /**
+     * Reference to the wrapper observer
+     */
+    ObserverList                                    mObservers;
+
+    /**
+     * Radio settings handler
+     * Own.
+     */
+    QScopedPointer<RadioSettings>                   mSettings;
+
+    QTimer*                                         mTuneTimer;
+
+    /**
+     * Preset scanning handler
+     * Own.
+     */
+//    QScopedPointer<RadioFrequencyScanningHandler>   mFrequencyScanningHandler;
+
+//    QScopedPointer<T_RadioDataParser>               mDataParser;
+
+    QString                                         mParsingError;
+
+    /**
+     * Reason for the tune event. RadioFrequencyStrip or someone else
+     */
+    int                                             mTuneReason;
+
+    /**
+     * Flag to indicate whether or not audio should be routed to loudspeaker
+     */
+    bool                                            mUseLoudspeaker;
+
+    QScopedPointer<QSettings>                       mEngineSettings;
+
+    bool                                            mAntennaAttached;
+
+    uint                                            mFrequency;
+    uint                                            mNextFrequency;
+
+    int                                             mVolume;
+
+    int                                             mMaxVolume;
+    int                                             mFrequencyStepSize;
+    RadioRegion::Region                             mRegionId;
+    uint                                            mMinFrequency;
+    uint                                            mMaxFrequency;
+
+    QString                                         mArtist;
+    QString                                         mTitle;
+
+};
+
+#endif // RADIOENGINEWRAPPER_P_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioenginewrapper/inc/radioenginewrapperobserver.h	Fri Jun 04 10:21:36 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:
+*
+*/
+
+#ifndef RADIOENGINEWRAPPEROBSERVER_H_
+#define RADIOENGINEWRAPPEROBSERVER_H_
+
+#include "radio_global.h"
+#include "radiowrapperexport.h"
+
+class WRAPPER_DLL_EXPORT RadioEngineWrapperObserver
+{
+public:
+
+    virtual void tunedToFrequency( uint frequency, int reason );
+
+    virtual void radioStatusChanged( bool radioIsOn );
+
+    virtual void rdsAvailabilityChanged( bool available );
+
+    virtual void volumeChanged( int volume );
+    virtual void muteChanged( bool muted );
+
+    virtual void audioRouteChanged( bool loudspeaker );
+    virtual void antennaStatusChanged( bool connected );
+
+    virtual void skipPrevious();
+    virtual void skipNext();
+
+};
+
+#endif // RADIOENGINEWRAPPEROBSERVER_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioenginewrapper/inc/radioenummapper.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,131 @@
+/*
+* 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 RADIOENUMMAPPER_H_
+#define RADIOENUMMAPPER_H_
+
+/*!
+ * Convenience macros to help define enum maps.
+ * Note! It is important to define the values so that the UI value is on the left
+ * and the engine value is on the right. The lookup functions expect them in this order.
+ *
+ * Example:
+ * BEGIN_ENUM_MAP( KSomeMap )
+ *   ENUM_MAP_ITEM( UiNamespace::UiValue1, EngineNamespace::EEngineValue1 ),
+ *   ENUM_MAP_ITEM( UiNamespace::UiValue2, EngineNamespace::EEngineValue2 )
+ * END_ENUM_MAP( KSomeMap )
+ */
+#define BEGIN_ENUM_MAP(name) const RadioEnumMapper::EnumMap name[] = {
+#define ENUM_MAP_ITEM(ui_enum, engine_enum ) { ui_enum, engine_enum }
+#define END_ENUM_MAP(name) }; const TInt name ## Count = sizeof ( name ) / sizeof ( name[0] );
+
+/*!
+ * Convenience macros to do the mappings
+ */
+#define MAP_FROM_UI_ENUM(type,uienum, map) RadioEnumMapper::FromUiEnum<type>( uienum, map, map ## Count )
+#define MAP_TO_UI_ENUM(type,uienum, map) RadioEnumMapper::ToUiEnum<type>( uienum, map, map ## Count )
+
+class RadioEnumMapper
+{
+public:
+
+    /*!
+     * Item in the enum map. Ties a value in the UI enum to its correspondent in the engine enum
+     */
+    struct EnumMap
+    {
+        int iUiEnum;
+        int iEngineEnum;
+    };
+
+    /*!
+     * Maps engine enum value to its ui correspondent.
+     *
+     * @param aValue Enum value in the engine
+     * @param aMap Enum value map
+     * @param aCount Amount of items in the map
+     * @return Enum value in the ui
+     */
+    template<typename UI_ENUM, typename ENGINE_ENUM>
+    inline static UI_ENUM ToUiEnum( ENGINE_ENUM aValue, const EnumMap* aMap, int aCount )
+    {
+        return static_cast<UI_ENUM>( MapToUiEnum( aValue, aMap, aCount ) );
+    }
+
+    /*!
+     * Maps ui enum value to its engine correspondent.
+     *
+     * @param aValue Enum value in the Ui
+     * @param aMap Enum value map
+     * @param aCount Amount of items in the map
+     * @return Enum value in the engine
+     */
+    template<typename ENGINE_ENUM, typename UI_ENUM>
+    inline static ENGINE_ENUM FromUiEnum( UI_ENUM aValue, const EnumMap* aMap, int aCount )
+    {
+        return static_cast<ENGINE_ENUM>( MapFromUiEnum( aValue, aMap, aCount ) );
+    }
+
+private:
+
+    /*!
+     * Maps engine enum value to its ui correspondent.
+     * Type-unsafe version. Not to be used directly!
+     *
+     * @param aValue Enum value in the engine
+     * @param aMap Enum value map
+     * @param aCount Amount of items in the map
+     * @return Enum value in the ui
+     */
+    static int MapToUiEnum( int aValue, const EnumMap* aMap, int aCount )
+    {
+        for ( int i = 0; i < aCount; ++i ) {
+            if ( aMap[i].iUiEnum == aValue ) {
+                return aMap[i].iEngineEnum;
+            }
+        }
+        return -1;
+    }
+
+    /*!
+     * Maps ui enum value to its engine correspondent.
+     * Type-unsafe version. Not to be used directly!
+     *
+     * @param aValue Enum value in the Ui
+     * @param aMap Enum value map
+     * @param aCount Amount of items in the map
+     * @return Enum value in the engine
+     */
+    static int MapFromUiEnum( int aValue, const EnumMap* aMap, int aCount )
+    {
+        for ( int i = 0; i < aCount; ++i ) {
+            if ( aMap[i].iEngineEnum == aValue ) {
+                return aMap[i].iUiEnum;
+            }
+        }
+        return -1;
+    }
+
+    /*
+     * Hidden constructor and destructor to prevent instantiation
+     */
+    RadioEnumMapper() {}
+    ~RadioEnumMapper() {}
+
+};
+
+#endif // RADIOENUMMAPPER_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioenginewrapper/inc/radiordslistener.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef RADIORDSLISTENER_H_
+#define RADIORDSLISTENER_H_
+
+// user includes
+#include "mradiordsdataobserver.h"
+
+class RadioStationHandlerIf;
+class RadioEngineWrapperPrivate;
+
+class RadioRdsListener : public MRadioRdsDataObserver
+{
+public:
+
+    RadioRdsListener( RadioStationHandlerIf& stationHandler, RadioEngineWrapperPrivate& wrapper );
+
+private:
+
+// from base class MFMRadioRdsObserver
+
+    void RdsAvailable( TUint32 aFrequency, TBool aAvailable );
+    void RdsAfSearchBegin();
+    void RdsAfSearchEnd( TUint32 aFrequency, TInt aError );
+    void RdsAfSearchStateChange( TBool aEnabled );
+    void RdsDataProgrammeService( TUint32 aFrequency, const TDesC& aProgramService );
+    void RdsDataRadioText( TUint32 aFrequency, const TDesC& aRadioText );
+    void RdsDataRadioTextPlus( TUint32 aFrequency, const TInt aRadioTextPlusClass, const TDesC& aRadioText );
+    void RdsDataGenre( TUint32 aFrequency, const TInt aGenre );
+    void RdsDataPiCode( TUint32 aFrequency, const TInt aPiCode );
+
+private: //data
+
+    RadioStationHandlerIf& mStationHandler;
+
+    RadioEngineWrapperPrivate& mWrapper;
+};
+
+#endif // RADIORDSLISTENER_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioenginewrapper/inc/radiosettings.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,62 @@
+/*
+* 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 RADIOSETTINGS_H_
+#define RADIOSETTINGS_H_
+
+// System includes
+#include <QtGlobal>
+
+// User includes
+#include "radiosettingsif.h"
+
+// Forward declarations
+class RadioSettingsPrivate;
+
+// Class declaration
+class RadioSettings : public RadioSettingsIf
+    {
+    Q_DECLARE_PRIVATE_D( d_ptr, RadioSettings )
+    Q_DISABLE_COPY( RadioSettings )
+
+    friend class RadioEngineWrapperPrivate;
+
+public:
+
+    virtual ~RadioSettings();
+
+private:
+
+    RadioSettings();
+
+// from base class RadioSettingsIf
+
+    bool isFirstTimeStart();
+    bool showFavorites() const;
+    void setShowFavorites( bool showFavorites );
+    bool toggleShowFavorites();
+
+private: // data
+
+    /**
+     * Unmodifiable pointer to the private implementation
+     */
+    RadioSettingsPrivate* const d_ptr;
+
+    };
+
+#endif // RADIOSETTINGS_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioenginewrapper/inc/radiosettings_p.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,73 @@
+/*
+* 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 RADIOSETTINGS_P_H_
+#define RADIOSETTINGS_P_H_
+
+class MRadioApplicationSettings;
+
+class RadioSettingsPrivate
+{
+    Q_DECLARE_PUBLIC( RadioSettings )
+    Q_DISABLE_COPY( RadioSettingsPrivate )
+
+    /**
+     * On/Off type flags.
+     *
+     * Bit shifting in the value initialization is used to easily create
+     * progressing bit patterns like so:
+     *  1 << 0 equals 0001 equals 0x1
+     *  1 << 1 equals 0010 equals 0x2
+     *  1 << 2 equals 0100 equals 0x4
+     *  1 << 3 equals 1000 equals 0x8
+     */
+    enum ToggleFlag
+    {
+        EShowFavorites  = 1 << 0
+    };
+    Q_DECLARE_FLAGS( Toggles, ToggleFlag )
+
+public:
+
+    RadioSettingsPrivate( RadioSettings* settingsPublic );
+
+    ~RadioSettingsPrivate();
+
+    void init( MRadioApplicationSettings* storage );
+
+    // First time start
+    bool isFirstTimeStart();
+
+    bool isFlagSet( ToggleFlag flag ) const;
+    void toggleFlag( ToggleFlag flag );
+    void saveFlags();
+
+private: // data
+
+    /**
+     * Pointer to the public class
+     * Not own.
+     */
+    RadioSettings*              q_ptr;
+
+    Toggles                     mFlags;
+
+    MRadioApplicationSettings*  mSettingsStorage;
+
+};
+
+#endif // RADIOSETTINGS_P_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioenginewrapper/inc/radiosettingsif.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef RADIOSETTINGSIF_H_
+#define RADIOSETTINGSIF_H_
+
+// Class declaration
+class RadioSettingsIf
+    {
+public:
+
+    // First time start
+    virtual bool isFirstTimeStart() = 0;
+
+    // Favorites
+    virtual bool showFavorites() const = 0;
+    virtual void setShowFavorites( bool showFavorites ) = 0;
+    virtual bool toggleShowFavorites() = 0;
+
+    };
+
+#endif // RADIOSETTINGSIF_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioenginewrapper/inc/radiostationhandlerif.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,52 @@
+/*
+* 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 RADIOSTATIONHANDLERIF_H_
+#define RADIOSTATIONHANDLERIF_H_
+
+// System includes
+#include <QtGlobal>
+
+// Forward declarations
+class RadioStationIf;
+
+class RadioStationHandlerIf
+{
+public:
+
+    virtual uint currentFrequency() const = 0;
+    virtual int currentPresetIndex() const = 0;
+
+    virtual void setCurrentStation( uint frequency ) = 0;
+
+    virtual bool containsFrequency( uint frequency ) = 0;
+
+    virtual bool containsPresetIndex( int presetIndex ) = 0;
+
+    virtual void startDynamicPsCheck() = 0;
+
+    virtual void addScannedFrequency( uint frequency ) = 0;
+
+    virtual void setCurrentPsName( uint frequency, const QString& name ) = 0;
+    virtual void setCurrentRadioText( uint frequency, const QString& radioText ) = 0;
+    virtual void setCurrentRadioTextPlus( uint frequency, int rtClass, const QString& rtItem ) = 0;
+    virtual void setCurrentPiCode( uint frequency, int piCode ) = 0;
+    virtual void setCurrentGenre( uint frequency, int genre ) = 0;
+
+};
+
+#endif // RADIOSTATIONHANDLERIF_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioenginewrapper/inc/radiowrapperexport.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef RADIO_WRAPPER_EXPORT_H_
+#define RADIO_WRAPPER_EXPORT_H_
+
+// System includes
+#include <QtGlobal>
+
+#ifdef BUILD_WRAPPER_DLL
+    #define WRAPPER_DLL_EXPORT Q_DECL_EXPORT
+#else
+    #define WRAPPER_DLL_EXPORT Q_DECL_IMPORT
+#endif
+
+#endif // RADIO_WRAPPER_EXPORT_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioenginewrapper/inc/settings.xml	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,92 @@
+<radiosettings>
+    <setting name="maxvolume" value="10000" />
+    <setting name="FrequencyStepSize" value="100000" />
+    <setting name="Region" value="0" />
+    <setting name="MinFrequency" value="87500000" />
+    <setting name="MaxFrequency" value="108000000" />
+
+    <Station>
+        <setting name="Frequency" value="9500000" />
+        <RdsGroup interval="3" count="100">
+            <RdsItem type="PiCode" delay="0">0x54A8</RdsItem>
+            <RdsItem type="PsName" delay="1">Yle Suomi</RdsItem>
+        </RdsGroup>
+        <RdsGroup interval="3" count="100">
+            <RdsItem type="PiCode" delay="0">0x5fA8</RdsItem>
+            <RdsItem type="PsName" delay="1">Yle Oulu</RdsItem>
+            </Rds>
+        </RdsGroup>
+    </Station>
+
+    <Station>
+        <setting name="Frequency" value="88000000" />
+        <Rds type="PsName"><!-- Static PS -->
+            <setting name="SendInterval" value="8" />
+            <setting name="SendCount" value="4" />
+            <setting name="RdsContent" value="Radio Nova" />
+        </Rds>
+        <Rds type="PiCode">
+            <setting name="SendInterval" value="8" />
+            <setting name="RdsContent" value="0x54A8" />
+        </Rds>
+        <Rds type="Rt">
+            <setting name="SendInterval" value="4" />
+            <setting name="RdsContent" value="Radio Nova runs" />
+            <setting name="RdsContent" value="some ads in the" />
+            <setting name="RdsContent" value="radio text." />
+        </Rds>
+    </Station>
+    
+    <Station>
+        <setting name="Frequency" value="89000000" />
+        <Rds type="PsName">
+            <setting name="SendInterval" value="5" />
+            <setting name="SendCount" value="4" />
+            <setting name="RdsContent" value="Radio Rock" />
+        </Rds>
+        <Rds type="Pty">
+            <setting name="SendInterval" value="4" />
+            <setting name="RdsContent" value="12" />
+        </Rds>
+    </Station>
+    
+    <Station>
+        <setting name="Frequency" value="98000000" />
+        <Rds type="PsName">
+            <setting name="SendInterval" value="5" />
+            <setting name="RdsContent" value="Radio Mega" />
+        </Rds>
+        <Rds type="Rt">
+            <setting name="SendInterval" value="8" />
+            <setting name="RtPlusItem" value="Now playing: [artist] - [title]">
+                <setting name="RtPlusTag" value="artist">
+                    <setting name="delay" value="2" />
+                    <setting name="RdsContent" value="Metallica" />
+                </setting>
+                <setting name="RtPlusTag" value="title">
+                    <setting name="delay" value="2" />
+                    <setting name="RdsContent" value="One" />
+                </setting>
+            </setting>
+        </Rds>
+    </Station>
+    
+    <Station>
+        <setting name="Frequency" value="103000000" />
+        <Rds type="PsName"><!-- Dynamic PS -->
+            <setting name="SendInterval" value="2" />
+            <setting name="RdsContent" value="Radio Mega" />
+            <setting name="RdsContent" value="iskee" />
+            <setting name="RdsContent" value="makkarat" />
+            <setting name="RdsContent" value="ruutuun" />
+        </Rds>
+        <Rds type="Rt">
+            <setting name="SendInterval" value="4" />
+            <setting name="RdsContent" value="This is" />
+            <setting name="RdsContent" value="an example usage of" />
+            <setting name="RdsContent" value="radio text in a" />
+            <setting name="RdsContent" value="radio station." />
+        </Rds>
+    </Station>
+
+</radiosettings>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioenginewrapper/inc/t_radiodataparser.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,218 @@
+/*
+* 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 T_RADIODATAPARSER_H
+#define T_RADIODATAPARSER_H
+
+// System includes
+#include <QScopedPointer>
+#include <QXxml>
+#include <QString>
+#include <QList>
+
+// Forward declarations
+class T_RadioDataParser;
+
+namespace RadioData
+{
+    class SettingHolder;
+
+    /**
+     * Base class for all settings
+     */
+    class Setting
+    {
+    public:
+
+        virtual ~Setting() {}
+        virtual void setValue( SettingHolder& holder,
+                               T_RadioDataParser& parser ) {};
+
+    };
+
+    /**
+     * Holder to store a setting during parsing
+     */
+    class SettingHolder : public Setting
+    {
+    public:
+
+        SettingHolder();
+        ~SettingHolder();
+
+        QString                 mName;
+        QString                 mValue;
+        QList<SettingHolder*>   mChildren;
+
+    };
+
+    class RdsItem : public Setting
+    {
+    public:
+        enum Type
+            {
+             Unknown
+            ,RdsPsName
+            ,RdsRadioText
+            ,RdsRadioTextPlus
+            ,RdsPty
+            ,RdsPiCode
+            };
+
+        RdsItem();
+        ~RdsItem();
+
+        void setValue( SettingHolder& holder,
+                       T_RadioDataParser& parser );
+
+        void initChildren( SettingHolder& holder,
+                           T_RadioDataParser& parser );
+
+        enum rtClass{ Title = 1, Artist = 4, Homepage = 39 };
+
+        class RtPlusHolder
+        {
+        public:
+
+            RtPlusHolder();
+
+            int     mDelay;
+            int     mRtClass;
+            QString mRtItem;
+        };
+
+        Type                    mType;
+        QStringList             mRdsItems;
+        QList<RtPlusHolder*>    mRtPlusItems;
+        int                     mCurrentRtPlusIndex;
+
+    };
+
+    class RdsGroup : public Setting
+    {
+    public:
+
+        RdsGroup( const QXmlAttributes& atts, T_RadioDataParser& parser );
+        ~RdsGroup();
+
+        int mInterval;
+        int mCount;
+        QList<RdsItem*> mRdsItems;
+
+    };
+
+    class Station : public Setting
+    {
+    public:
+
+        Station();
+        ~Station();
+
+        void setValue( SettingHolder& holder,
+                       T_RadioDataParser& parser );
+
+        uint                mFrequency;
+        QList<RdsGroup*>    mRdsArray;
+
+    };
+
+    class EngineSettings : public Setting
+    {
+    public:
+
+        EngineSettings();
+
+        void setValue( SettingHolder& holder,
+                       T_RadioDataParser& parser );
+
+        int     mMaxVolume;
+        int     mFrequencyStepSize;
+        int     mRegionId;
+        uint    mMinFrequency;
+        uint    mMaxFrequency;
+
+    };
+
+    typedef QList<Setting*> SettingArray;
+
+}
+
+class T_RadioDataParser : public QXmlDefaultHandler
+{
+public:
+
+    T_RadioDataParser();
+    virtual ~T_RadioDataParser();
+
+    bool parse();
+
+    QString errorString() const;
+
+    int parseInt( const QString& string, int defaultVal );
+    int parseTime( const QString& string, int defaultVal );
+
+private:
+
+// from base class QXmlDefaultHandler
+
+    bool startDocument();
+    bool endDocument();
+    bool startElement( const QString& namespaceURI, const QString& localName, const QString& qName, const QXmlAttributes& atts );
+    bool endElement( const QString& namespaceURI, const QString& localName, const QString& qName );
+    bool characters( const QString& ch );
+    bool error( const QXmlParseException& exception );
+    bool fatalError( const QXmlParseException& exception );
+
+// New functions
+
+    void handleStartRadioSettings( const QXmlAttributes& atts );
+    void handleEndRadioSettings();
+    void handleStartSetting( const QXmlAttributes& atts );
+    void handleEndSetting();
+    void handleStartStation( const QXmlAttributes& atts );
+    void handleEndStation();
+    void handleStartRdsGroup( const QXmlAttributes& atts );
+    void handleEndRdsGroup();
+    void handleStartRdsData( const QXmlAttributes& atts );
+    void handleEndRdsData();
+
+    void pushToSettingStack( RadioData::Setting* setting, RadioData::SettingArray& array );
+    RadioData::Setting* topOfSettingStack( RadioData::SettingArray& array );
+    RadioData::Setting* popFromSettingStack( RadioData::SettingArray& array );
+
+private: // data
+
+    QScopedPointer<QXmlSimpleReader>    mReader;
+    QScopedPointer<QXmlInputSource>     mSource;
+
+    QString                             mErrorString;
+
+    int                                 mCurrentPresetIndex;
+
+    RadioData::SettingArray             mSettingStack;
+
+    RadioData::SettingArray             mSettingHolderStack;
+
+public:
+
+    RadioData::EngineSettings           mEngineSettings;
+
+    QList<RadioData::Station*>          mStations;
+
+};
+
+#endif // T_RADIODATAPARSER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioenginewrapper/radioenginewrapper.pro	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,87 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+include(../buildflags.pri)
+
+TEMPLATE    = lib
+TARGET      = radioenginewrapper
+CONFIG      += dll
+DEFINES     += BUILD_WRAPPER_DLL
+
+USE_DUMMY_RADIO_DATA:QT += xml
+
+INCLUDEPATH += inc
+INCLUDEPATH += ../commoninc
+
+# Common headers
+HEADERS     += radiowrapperexport.h
+HEADERS     += radio_global.h
+HEADERS     += radiologger.h
+HEADERS     += radioenginewrapper.h
+HEADERS     += radiosettingsif.h
+HEADERS     += radiosettings.h
+HEADERS     += radiostationhandlerif.h
+HEADERS     += radioenginewrapperobserver.h
+
+INTERNAL_HEADERS += radiosettings_p.h
+
+#USE_DUMMY_RADIO_DATA:HEADERS += t_radiodataparser.h
+
+# Common sources
+SOURCES     += radiosettings.cpp
+SOURCES     += radiologger.cpp
+SOURCES     += radioenginewrapperobserver.cpp
+
+# Symbian specific stuff
+symbian: {
+    INCLUDEPATH += ../../radioengine/utils/api
+    INCLUDEPATH += ../../radioengine/settings/api
+    INCLUDEPATH += ../../radioengine/engine/api
+
+    LIBS *= -lradioengineutils
+    LIBS *= -lradioenginesettings
+    LIBS *= -lradioengine
+
+    HEADERS += cradioenginehandler.h
+    HEADERS += mradioenginehandlerobserver.h
+    HEADERS += radiocontroleventlistener.h
+    HEADERS += radiordslistener.h
+
+    INTERNAL_HEADERS += radioenginewrapper_p.h
+
+    SOURCES += radiosettings_p.cpp
+    SOURCES += radioenginewrapper.cpp
+    SOURCES += radioenginewrapper_p.cpp
+    SOURCES += cradioenginehandler.cpp
+    SOURCES += radiocontroleventlistener.cpp
+    SOURCES += radiordslistener.cpp
+}
+
+#USE_DUMMY_RADIO_DATA:SOURCES += t_radiodataparser.cpp
+
+# Win32 specific stuff
+win32: {
+    INCLUDEPATH += inc/win32
+
+    HEADERS += radioenginewrapper_win32_p.h
+    HEADERS += $$INTERNAL_HEADERS
+
+    SOURCES += radiosettings_win32_p.cpp
+    SOURCES += radioenginewrapper_win32.cpp
+    SOURCES += radioenginewrapper_win32_p.cpp
+}
+
+DEPENDPATH  += $$INCLUDEPATH src
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioenginewrapper/src/cradioenginehandler.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,461 @@
+/*
+* 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:
+*
+*/
+
+// User includes
+#include "cradioengine.h"
+#include "cradioaudiorouter.h"
+#include "cradiosystemeventcollector.h"
+#include "cradiosettings.h"
+#include "mradioenginesettings.h"
+#include "cradiopubsub.h"
+#include "cradiorepositorymanager.h"
+#include "mradiordsreceiver.h"
+#include "cradioenginehandler.h"
+#include "mradioenginehandlerobserver.h"
+#include "radio_global.h"
+#include "radiologger.h"
+#include "radioenummapper.h"
+
+/**
+ * Delayed tuning delay
+ */
+const TInt KTuneDelay = 100000;
+
+/*!
+ * Map to translate seek direction enum from its definition in the engine to
+ * its definition in the ui and vice versa
+ */
+BEGIN_ENUM_MAP( KSeekDirectionMap )
+    ENUM_MAP_ITEM( Seeking::Down, RadioEngine::ERadioDown ),
+    ENUM_MAP_ITEM( Seeking::Up,   RadioEngine::ERadioUp )
+END_ENUM_MAP( KSeekDirectionMap )
+
+/*!
+ * Convenience macro to do the mapping of seek directions
+ */
+#define MAP_FROM_UI_DIRECTION(ui_enum) MAP_FROM_UI_ENUM( RadioEngine::TRadioTuneDirection, ui_enum, KSeekDirectionMap )
+
+/*!
+ * Map to translate radio region enum from its definition in the engine to
+ * its definition in the ui and vice versa
+ */
+BEGIN_ENUM_MAP( KRegionMap )
+    ENUM_MAP_ITEM( RadioRegion::None,       ERadioRegionNone ),
+    ENUM_MAP_ITEM( RadioRegion::Default,    ERadioRegionDefault ),
+    ENUM_MAP_ITEM( RadioRegion::Japan,      ERadioRegionJapan ),
+    ENUM_MAP_ITEM( RadioRegion::America,    ERadioRegionAmerica ),
+    ENUM_MAP_ITEM( RadioRegion::Poland,     ERadioRegionPoland ),
+END_ENUM_MAP( KRegionMap )
+
+/*!
+ * Convenience macros to do the mapping of radio regions
+ */
+#define MAP_FROM_UI_REGION(ui_enum) MAP_FROM_UI_ENUM( TRadioRegion, ui_enum, KRegionMap )
+#define MAP_TO_UI_REGION(engine_enum) MAP_TO_UI_ENUM( RadioRegion::Region, engine_enum, KRegionMap )
+
+/*!
+ * Map to translate seeking state enum from its definition in the engine to
+ * its definition in the ui and vice versa
+ */
+BEGIN_ENUM_MAP( KSeekingStateMap )
+    ENUM_MAP_ITEM( Seeking::NotSeeking,     RadioEngine::ERadioNotSeeking ),
+    ENUM_MAP_ITEM( Seeking::SeekingUp,      RadioEngine::ERadioSeekingUp ),
+    ENUM_MAP_ITEM( Seeking::SeekingDown,    RadioEngine::ERadioSeekingDown )
+END_ENUM_MAP( KSeekingStateMap )
+
+/*!
+ * Convenience macro to do the mapping of seeking states
+ */
+#define MAP_TO_UI_SEEKING_STATE(ui_enum) MAP_TO_UI_ENUM( Seeking::State, ui_enum, KSeekingStateMap )
+
+
+// ======== MEMBER FUNCTIONS ========
+
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioEngineHandler::CRadioEngineHandler( MRadioEngineHandlerObserver& aObserver )
+    : iObserver( aObserver )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioEngineHandler::~CRadioEngineHandler()
+    {
+    if ( iEngine ) {
+        iEngine->Settings().Repository().RemoveObserver( &iObserver );
+    }
+
+    delete iEngine;
+    delete iDelayTimer;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineHandler::ConstructL()
+    {
+    LOG_METHOD;
+
+    iDelayTimer = CPeriodic::NewL( CActive::EPriorityStandard );
+
+    iEngine = CRadioEngine::NewL( *this );
+
+    iEngine->SystemEventCollector().AddObserverL( &iObserver );
+    iEngine->Settings().Repository().AddObserverL( &iObserver );
+    iEngine->AudioRouter().SetAudioRouteL( RadioEngine::ERadioHeadset );
+    iEngine->AddObserverL( &iObserver );
+
+    iRegion = MAP_TO_UI_REGION( iEngine->Settings().EngineSettings().RegionId() );
+
+//    iEngineHolder->PubSub().SetControlEventObserver( &iObserver );
+
+//    iRadioEngine->SetVolumeMuted( EFalse );
+//    iRadioEngine->SetVolume( MaxVolume() );
+
+//    CVRRepositoryManager::GetRepositoryValueL( KVRCRUid, KVRCRLaunchCount, usageCount );
+//    CVRRepositoryManager::SetRepositoryValueL( KVRCRUid, KVRCRLaunchCount, ++usageCount );
+//    iControlEventObserver = CVRControlEventObserverImpl::NewL( *this );
+//    doc->PubSubL().SetControlEventObserver( iControlEventObserver );
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the rds data observer
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineHandler::SetRdsObserver( MRadioRdsDataObserver* aObserver )
+    {
+    TRAP_IGNORE( iEngine->RdsReceiver().AddObserverL( aObserver ) );
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the radio status.
+// ---------------------------------------------------------------------------
+//
+TBool CRadioEngineHandler::IsRadioOn()
+    {
+    return iEngine->Settings().EngineSettings().IsPowerOn();
+    }
+
+// ---------------------------------------------------------------------------
+// Tune to the specified frequency
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineHandler::Tune( TUint aFrequency )
+    {
+    iEngine->SetFrequency( aFrequency );
+    }
+
+// ---------------------------------------------------------------------------
+// Tune to the specified frequency after a delay
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineHandler::TuneWithDelay( TUint aFrequency )
+    {
+    iFrequency = aFrequency;
+    iDelayTimer->Cancel();
+    iDelayTimer->Start( KTuneDelay, KTuneDelay, TCallBack( TuneDelayCallback, this ) );
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the audio mute state
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineHandler::SetMuted( const TBool aMuted )
+    {
+    iEngine->SetVolumeMuted( aMuted );
+    }
+
+// ---------------------------------------------------------------------------
+// Gets the audio mute state
+// ---------------------------------------------------------------------------
+//
+TBool CRadioEngineHandler::IsMuted() const
+    {
+    return iEngine->Settings().EngineSettings().IsVolMuted();
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the volume level of the FM radio
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineHandler::SetVolume( TInt aVolume )
+    {
+    if ( Volume() != aVolume )
+        {
+        if ( aVolume > 0 )
+            {
+            iEngine->SetVolumeMuted( EFalse );
+            }
+
+        iEngine->SetVolume( aVolume );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Gets the volumelevel.
+// ---------------------------------------------------------------------------
+//
+TInt CRadioEngineHandler::Volume() const
+    {
+    return iEngine->Settings().EngineSettings().Volume();
+    }
+
+// ---------------------------------------------------------------------------
+// Gets the max volumelevel.
+// ---------------------------------------------------------------------------
+//
+TInt CRadioEngineHandler::MaxVolume() const
+    {
+    return iEngine->MaxVolumeLevel();
+    }
+
+// ---------------------------------------------------------------------------
+// Increases the volume by one increment
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineHandler::IncreaseVolume()
+    {
+    iEngine->AdjustVolume( RadioEngine::ERadioIncVolume );
+    }
+
+// ---------------------------------------------------------------------------
+// Decreases the volume by one increment
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineHandler::DecreaseVolume()
+    {
+    iEngine->AdjustVolume( RadioEngine::ERadioDecVolume );
+    }
+
+// ---------------------------------------------------------------------------
+// Checks if the antenna is attached
+// ---------------------------------------------------------------------------
+//
+TBool CRadioEngineHandler::IsAntennaAttached() const
+    {
+    return iEngine->IsAntennaAttached();
+    }
+
+// ---------------------------------------------------------------------------
+// Retrieves the current frequency.
+// ---------------------------------------------------------------------------
+//
+TUint CRadioEngineHandler::TunedFrequency() const
+    {
+    return iEngine->Settings().EngineSettings().TunedFrequency();
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the minimum allowed frequency in the current region
+// ---------------------------------------------------------------------------
+//
+TUint CRadioEngineHandler::MinFrequency() const
+    {
+    return iEngine->Settings().EngineSettings().MinFrequency();
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the maximum allowed frequency in the current region
+// ---------------------------------------------------------------------------
+//
+TUint CRadioEngineHandler::MaxFrequency() const
+    {
+    return iEngine->Settings().EngineSettings().MaxFrequency();
+    }
+
+// ---------------------------------------------------------------------------
+// Checks if the given frequency is valid in the current region
+// ---------------------------------------------------------------------------
+//
+TBool CRadioEngineHandler::IsFrequencyValid( TUint aFrequency ) const
+    {
+    return iEngine->IsFrequencyValid( aFrequency );
+    }
+
+// ---------------------------------------------------------------------------
+// Scan up to the next available frequency
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineHandler::Seek( Seeking::Direction direction )
+    {
+    LOG_TIMESTAMP( "Seek" );
+    iEngine->Seek( MAP_FROM_UI_DIRECTION( direction ) );
+    }
+
+// ---------------------------------------------------------------------------
+// Cancel previously requested scan, and return to the
+// already tuned frequency
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineHandler::CancelSeek()
+    {
+    iEngine->CancelSeek();
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the engine seeking state
+// ---------------------------------------------------------------------------
+//
+Seeking::State CRadioEngineHandler::SeekingState() const
+    {
+    return MAP_TO_UI_SEEKING_STATE( iEngine->Seeking() );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineHandler::StartScan( MRadioScanObserver& aObserver )
+    {
+    iEngine->StartScan( aObserver );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineHandler::StopScan( TInt aError )
+    {
+    iEngine->StopScan( aError );
+    }
+
+// ---------------------------------------------------------------------------
+// return step size for tuning.
+// ---------------------------------------------------------------------------
+//
+TUint32 CRadioEngineHandler::FrequencyStepSize() const
+    {
+    return iEngine->Settings().EngineSettings().FrequencyStepSize();
+    }
+
+// ----------------------------------------------------------------------------------------------------
+// Returns the selected radio region
+// ----------------------------------------------------------------------------------------------------
+//
+RadioRegion::Region CRadioEngineHandler::Region() const
+    {
+    return iRegion;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets whether or not audio should be routed to loudspeaker
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineHandler::SetAudioRouteToLoudspeaker( TBool aLoudspeaker )
+    {
+    TRAPD( err, iEngine->AudioRouter().SetAudioRouteL( aLoudspeaker ? RadioEngine::ERadioSpeaker
+                                                         : RadioEngine::ERadioHeadset ) );
+    if ( err )
+        {
+        LOG_FORMAT( "Failed to set audioroute: UseLoudspeadker: %d", aLoudspeaker );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Checks if audio is routed to loudspeaker
+// ---------------------------------------------------------------------------
+//
+TBool CRadioEngineHandler::IsAudioRoutedToLoudspeaker() const
+    {
+    return iEngine->Settings().EngineSettings().AudioRoute() == RadioEngine::ERadioSpeaker;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns ar reference to the publish & subscribe handler
+// ---------------------------------------------------------------------------
+//
+CRadioPubSub& CRadioEngineHandler::PubSub()
+    {
+    return *iEngine->PubSub();
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the repository manager.
+// ---------------------------------------------------------------------------
+//
+CRadioRepositoryManager& CRadioEngineHandler::Repository() const
+    {
+    return iEngine->Settings().Repository();
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the repository manager.
+// ---------------------------------------------------------------------------
+//
+MRadioApplicationSettings& CRadioEngineHandler::ApplicationSettings() const
+    {
+    return iEngine->Settings().ApplicationSettings();
+    }
+
+// ---------------------------------------------------------------------------
+// From MRadioEngineInitializer
+//
+// ---------------------------------------------------------------------------
+//
+CRadioAudioRouter* CRadioEngineHandler::InitAudioRouterL()
+    {
+    return CRadioAudioRouter::NewL( iObserver );
+    }
+
+// ---------------------------------------------------------------------------
+// From MRadioEngineInitializer
+//
+// ---------------------------------------------------------------------------
+//
+CRadioSystemEventCollector* CRadioEngineHandler::InitSystemEventCollectorL()
+    {
+    return CRadioSystemEventCollector::NewL();
+    }
+
+// ---------------------------------------------------------------------------
+// From MRadioEngineInitializer
+//
+// ---------------------------------------------------------------------------
+//
+CRadioSettings* CRadioEngineHandler::InitSettingsL()
+    {
+    return CRadioSettings::NewL();
+    }
+
+// ---------------------------------------------------------------------------
+// From MRadioEngineInitializer
+//
+// ---------------------------------------------------------------------------
+//
+CRadioPubSub* CRadioEngineHandler::InitPubSubL()
+    {
+    return CRadioPubSub::NewL();
+    }
+
+// --------------------------------------------------------------------------------
+// Static callback function to be used by the tune delay timer
+// --------------------------------------------------------------------------------
+//
+TInt CRadioEngineHandler::TuneDelayCallback( TAny* aSelf )
+    {
+    CRadioEngineHandler* self = static_cast<CRadioEngineHandler*>( aSelf );
+    self->iDelayTimer->Cancel();
+    self->Tune( self->iFrequency );
+    return 0; // Not used by CPeriodic
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioenginewrapper/src/radiocontroleventlistener.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,254 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "radiocontroleventlistener.h"
+#include "radioenginewrapper_p.h"
+#include "radioenginewrapperobserver.h"
+#include "cradioenginehandler.h"
+#include "radiologger.h"
+#include "cradioremcontarget.h"
+/*!
+ *
+ */
+RadioControlEventListener::RadioControlEventListener( RadioEngineWrapperPrivate& engine ) :
+    mEngine( engine )
+{
+}
+
+/*!
+ *
+ */
+RadioControlEventListener::~RadioControlEventListener()
+{
+}
+
+/*!
+ *
+ */
+void RadioControlEventListener::init()
+{
+    TRAPD( err, mRemCon.reset( CRadioRemConTarget::NewL() ) );
+    LOG_ASSERT( !err, LOG_FORMAT( "RadioControlEventListener::init Failed with err, %d", err ) );
+
+    if ( !err ) {
+        mRemCon->SetControlEventObserver( this );
+    }
+}
+
+/*!
+ *
+ */
+void RadioControlEventListener::StepToChannelL( RadioEngine::TRadioTuneDirection DEBUGVAR( aDirection ) )
+{
+    LOG_FORMAT( "RadioControlEventListener::StepToChannelL: direction: %d", aDirection );
+}
+
+/*!
+ *
+ */
+void RadioControlEventListener::SetChannelL( TInt DEBUGVAR( aChannelId ) )
+{
+    LOG_FORMAT( "RadioControlEventListener::SetChannelL: Channel: %d", aChannelId );
+}
+
+/*!
+ *
+ */
+void RadioControlEventListener::SeekL( RadioEngine::TRadioTuneDirection aDirection )
+{
+    LOG_FORMAT( "RadioControlEventListener::SeekL: Direction: %d", aDirection );
+    mEngine.startSeeking( aDirection == RadioEngine::ERadioDown ? Seeking::Down : Seeking::Up );
+}
+
+/*!
+ *
+ */
+void RadioControlEventListener::StepToFrequencyL( RadioEngine::TRadioTuneDirection DEBUGVAR( aDirection ) )
+{
+    LOG_FORMAT( "RadioControlEventListener::StepToFrequencyL: Direction: %d", aDirection );
+}
+
+/*!
+ *
+ */
+void RadioControlEventListener::SetFrequencyL( TUint32 DEBUGVAR( aFreq ) )
+{
+    LOG_FORMAT( "RadioControlEventListener::SetFrequencyL: Frequency: %d", aFreq );
+}
+
+/*!
+ *
+ */
+void RadioControlEventListener::AdjustVolumeL( RadioEngine::TRadioVolumeSetDirection DEBUGVAR( aDirection ) )
+{
+    LOG_FORMAT( "RadioControlEventListener::AdjustVolumeL: Direction: %d", aDirection );
+}
+
+/*!
+ *
+ */
+void RadioControlEventListener::MuteL( TBool aMute )
+{
+    LOG_FORMAT( "RadioControlEventListener::MuteL: Mute: %d", aMute );
+    mEngine.RadioEnginehandler().SetMuted( aMute );
+}
+
+/*!
+ *
+ */
+void RadioControlEventListener::PlayL( TBool aDownPressed )
+{
+    if( aDownPressed )
+        {
+        mEngine.RadioEnginehandler().SetMuted( false );
+        }
+}
+
+/*!
+ *
+ */
+void RadioControlEventListener::PauseL( TBool aDownPressed )
+{
+    if( aDownPressed )
+        {
+        mEngine.RadioEnginehandler().SetMuted( true );
+        }
+}
+
+/*!
+ *
+ */
+void RadioControlEventListener::PausePlayL( TBool aDownPressed )
+{
+    if( aDownPressed )
+        {
+        const TBool muted = !mEngine.RadioEnginehandler().IsMuted();
+        mEngine.RadioEnginehandler().SetMuted( muted );
+        }
+}
+
+/*!
+ *
+ */
+void RadioControlEventListener::StopL( TBool aDownPressed )
+{
+    if( aDownPressed )
+        {
+        mEngine.RadioEnginehandler().SetMuted( ETrue );
+        }
+}
+
+/*!
+ *
+ */
+void RadioControlEventListener::ForwardL( TBool aDownPressed )
+{
+    if( aDownPressed ) {
+        RUN_NOTIFY_LOOP( mEngine.observers(), skipNext() );
+    }
+}
+
+/*!
+ *
+ */
+void RadioControlEventListener::FastForwardL( TBool aDownPressed )
+{
+    if( aDownPressed )
+    {
+        mEngine.startSeeking( Seeking::Up );
+    }
+}
+
+/*!
+ *
+ */
+void RadioControlEventListener::BackwardL( TBool aDownPressed )
+{
+    if( aDownPressed ) {
+        RUN_NOTIFY_LOOP( mEngine.observers(), skipPrevious() );
+    }
+}
+
+/*!
+ *
+ */
+void RadioControlEventListener::RewindL( TBool aDownPressed )
+{
+    if( aDownPressed ) {
+        mEngine.startSeeking( Seeking::Down );
+    }
+}
+
+/*!
+ *
+ */
+void RadioControlEventListener::ChannelUpL( TBool DEBUGVAR( aDownPressed ) )
+{
+    LOG_FORMAT( "RadioControlEventListener::ChannelUpL: Down: %d", aDownPressed );
+}
+
+/*!
+ *
+ */
+void RadioControlEventListener::ChannelDownL( TBool DEBUGVAR( aDownPressed ) )
+{
+    LOG_FORMAT( "RadioControlEventListener::ChannelDownL: Down: %d", aDownPressed );
+}
+
+/*!
+ *
+ */
+void RadioControlEventListener::VolumeUpL( TBool aDownPressed )
+{
+    if ( aDownPressed ) {
+        mEngine.RadioEnginehandler().IncreaseVolume();
+    }
+}
+
+/*!
+ *
+ */
+void RadioControlEventListener::VolumeDownL( TBool aDownPressed )
+{
+    if ( aDownPressed ) {
+        mEngine.RadioEnginehandler().DecreaseVolume();
+    }
+}
+
+/*!
+ *
+ */
+void RadioControlEventListener::ChangeViewL( TUid DEBUGVAR( aViewId ), TBool DEBUGVAR( aForceChange ) )
+{
+    LOG_FORMAT( "RadioControlEventListener::ChangeViewL: View: %d, Force: %d", aViewId, aForceChange );
+}
+
+/*!
+ *
+ */
+void RadioControlEventListener::SetAudioRouteL( RadioEngine::TRadioAudioRoute DEBUGVAR( aRoute ) )
+{
+    LOG_FORMAT( "RadioControlEventListener::SetAudioOutputDestinationL: Destinatio: %d", aRoute );
+}
+
+/*!
+ *
+ */
+void RadioControlEventListener::AnswerEndCallL()
+{
+    RUN_NOTIFY_LOOP( mEngine.observers(), skipNext() );
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioenginewrapper/src/radioenginewrapper.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,229 @@
+/*
+* 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:
+*
+*/
+
+// User includes
+#include "radioenginewrapper.h"
+#include "radioenginewrapper_p.h"
+#include "cradioenginehandler.h"
+
+/*!
+ * Constructor
+ */
+RadioEngineWrapper::RadioEngineWrapper( RadioStationHandlerIf& stationHandler ) :
+    d_ptr( new RadioEngineWrapperPrivate( this, stationHandler ) )
+{
+    Q_D( RadioEngineWrapper );
+    d->init();
+}
+
+/*!
+ * Destructor
+ */
+RadioEngineWrapper::~RadioEngineWrapper()
+{
+    delete d_ptr;
+}
+
+/*!
+ *
+ */
+void RadioEngineWrapper::addObserver( RadioEngineWrapperObserver* observer )
+{
+    Q_D( RadioEngineWrapper );
+    d->mObservers.append( observer );
+}
+
+/*!
+ *
+ */
+void RadioEngineWrapper::removeObserver( RadioEngineWrapperObserver* observer )
+{
+    Q_D( RadioEngineWrapper );
+    d->mObservers.removeAll( observer );
+}
+
+/*!
+ * Checks if the radio engine has been constructed properly
+ */
+bool RadioEngineWrapper::isEngineConstructed()
+{
+    Q_D( RadioEngineWrapper );
+    return d->isEngineConstructed();
+}
+
+/*!
+ * Returns the settings handler owned by the engine
+ */
+RadioSettingsIf& RadioEngineWrapper::settings()
+{
+    Q_D( RadioEngineWrapper );
+    return d->settings();
+}
+
+/*!
+ * Returns the selected radio region
+ */
+RadioRegion::Region RadioEngineWrapper::region() const
+{
+    Q_D( const RadioEngineWrapper );
+    return d->mEngineHandler->Region();
+}
+
+/*!
+ * Returns the minimum frequency
+ */
+uint RadioEngineWrapper::minFrequency() const
+{
+    Q_D( const RadioEngineWrapper );
+    return d->mEngineHandler->MinFrequency();
+}
+
+/*!
+ * Returns the maximum frequency
+ */
+uint RadioEngineWrapper::maxFrequency() const
+{
+    Q_D( const RadioEngineWrapper );
+    return d->mEngineHandler->MaxFrequency();
+}
+
+/*!
+ * Returns the frequency step size from the selected region
+ */
+uint RadioEngineWrapper::frequencyStepSize() const
+{
+    Q_D( const RadioEngineWrapper );
+    return d->mEngineHandler->FrequencyStepSize();
+}
+
+/*!
+ * Returns the frequency step size from the selected region
+ */
+bool RadioEngineWrapper::isFrequencyValid( uint frequency )
+{
+    Q_D( const RadioEngineWrapper );
+    return d->mEngineHandler->IsFrequencyValid( frequency );
+}
+
+/*!
+ * Checks if the radio engine is on
+ */
+bool RadioEngineWrapper::isRadioOn() const
+{
+    Q_D( const RadioEngineWrapper );
+    return d->mEngineHandler->IsRadioOn();
+}
+
+/*!
+ * Returns the currently tuned frequency
+ */
+uint RadioEngineWrapper::currentFrequency() const
+{
+    Q_D( const RadioEngineWrapper );
+    return d->mEngineHandler->TunedFrequency();
+}
+
+/*!
+ * Returns the mute status
+ */
+bool RadioEngineWrapper::isMuted() const
+{
+    Q_D( const RadioEngineWrapper );
+    return d->mEngineHandler->IsMuted();
+}
+
+/*!
+ * Returns the antenna connection status
+ */
+bool RadioEngineWrapper::isAntennaAttached() const
+{
+    Q_D( const RadioEngineWrapper );
+    return d->mEngineHandler->IsAntennaAttached();
+}
+
+/*!
+ * Returns the "use loudspeaker" status
+ */
+bool RadioEngineWrapper::isUsingLoudspeaker() const
+{
+    Q_D( const RadioEngineWrapper );
+    return d->mUseLoudspeaker;
+}
+
+/*!
+ * Tunes to the given frequency
+ */
+void RadioEngineWrapper::tuneFrequency( uint frequency, const int reason )
+{
+    Q_D( RadioEngineWrapper );
+    d->tuneFrequency( frequency, reason );
+}
+
+/*!
+ * Tunes to the given frequency after a delay
+ */
+void RadioEngineWrapper::tuneWithDelay( uint frequency, const int reason )
+{
+    Q_D( RadioEngineWrapper );
+    d->tuneWithDelay( frequency, reason );
+}
+
+/*!
+ * volume update command for the engine
+ */
+void RadioEngineWrapper::setVolume( int volume )
+{
+    Q_D( RadioEngineWrapper );
+    d->mEngineHandler->SetVolume( volume );
+}
+
+/*!
+ *
+ */
+void RadioEngineWrapper::setMute( bool muted )
+{
+    Q_D( RadioEngineWrapper );
+    d->mEngineHandler->SetMuted( muted );
+}
+
+/*!
+ *
+ */
+void RadioEngineWrapper::toggleAudioRoute()
+{
+    Q_D( RadioEngineWrapper );
+    d->mUseLoudspeaker = !d->mUseLoudspeaker;
+    d->mEngineHandler->SetAudioRouteToLoudspeaker( d->mUseLoudspeaker );
+}
+
+/*!
+ *
+ */
+void RadioEngineWrapper::startSeeking( Seeking::Direction direction, const int reason )
+{
+    Q_D( RadioEngineWrapper );
+    d->startSeeking( direction, reason );
+}
+
+/*!
+ *
+ */
+void RadioEngineWrapper::cancelSeeking()
+{
+    Q_D( RadioEngineWrapper );
+    d->mEngineHandler->CancelSeek();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioenginewrapper/src/radioenginewrapper_p.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,280 @@
+/*
+* 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:
+*
+*/
+
+// System includes
+
+// User includes
+#include "radioenginewrapper_p.h"
+#include "radiosettings.h"
+#include "radiosettings_p.h"
+#include "radiologger.h"
+#include "radio_global.h"
+#include "cradioenginehandler.h"
+#include "radiostationhandlerif.h"
+#include "cradiopubsub.h"
+#include "radiocontroleventlistener.h"
+#include "radiordslistener.h"
+#include "cradiorepositorymanager.h"
+#include "radioenginewrapperobserver.h"
+
+// Constants
+
+/*!
+ *
+ */
+RadioEngineWrapperPrivate::RadioEngineWrapperPrivate( RadioEngineWrapper* wrapper,
+                                                      RadioStationHandlerIf& stationHandler ) :
+    q_ptr( wrapper ),
+    mStationHandler( stationHandler ),
+    mEngineHandler( new CRadioEngineHandler( *this ) ),
+    mControlEventListener( new RadioControlEventListener( *this ) ),
+    mRdsListener ( new RadioRdsListener( mStationHandler, *this ) ),
+    mTuneReason( 0 ),
+    mUseLoudspeaker( false )
+{
+}
+
+/*!
+ *
+ */
+RadioEngineWrapperPrivate::~RadioEngineWrapperPrivate()
+{
+    // Destructor needs to be defined because some member variables that are forward declared
+    // in the header are managed by QT's smart pointers and they require that the owning class
+    // has a non-inlined destructor. Compiler generates an inlined destructor if it isn't defined.
+}
+
+/*!
+ * Initializes the private implementation
+ */
+void RadioEngineWrapperPrivate::init()
+{
+    TRAPD( err, mEngineHandler->ConstructL() );
+    if ( err != KErrNone ) {
+        LOG_FORMAT( "RadioEngineWrapperPrivate::init, EngineHandler construct failed: %d", err );
+        mEngineHandler.reset();
+        return;
+        //TODO: Error handling?
+    }
+
+    mEngineHandler->SetRdsObserver( mRdsListener.data() );
+    mEngineHandler->PubSub().SetControlEventObserver( mControlEventListener.data() );
+    mControlEventListener->init();
+
+    // Start observing profile changes
+    mEngineHandler->Repository().AddEntityL( KCRUidProfileEngine,
+                                             KProEngActiveProfile,
+                                             CRadioRepositoryManager::ERadioEntityInt );
+
+    mUseLoudspeaker = mEngineHandler->IsAudioRoutedToLoudspeaker();
+    if ( !mUseLoudspeaker ) {
+        RUN_NOTIFY_LOOP( mObservers, audioRouteChanged( false ) );
+    }
+}
+
+/*!
+ * Starts up the radio engine
+ */
+bool RadioEngineWrapperPrivate::isEngineConstructed()
+{
+    return mEngineHandler != 0;
+}
+
+/*!
+ * Returns the settings handler owned by the engine
+ */
+RadioSettingsIf& RadioEngineWrapperPrivate::settings()
+{
+    if ( !mSettings ) {
+        mSettings.reset( new RadioSettings() );
+        mSettings->d_func()->init( &mEngineHandler->ApplicationSettings() );
+    }
+    return *mSettings;
+}
+
+/*!
+ * Returns the enginehandler owned by the engine
+ */
+CRadioEngineHandler& RadioEngineWrapperPrivate::RadioEnginehandler()
+{
+    return *mEngineHandler;
+}
+
+/*!
+ * Tunes to the given frequency
+ */
+void RadioEngineWrapperPrivate::tuneFrequency( uint frequency, const int reason )
+{
+    if ( mEngineHandler->TunedFrequency() != frequency ) {
+        mTuneReason = reason;
+        mEngineHandler->Tune( frequency );
+    }
+}
+
+/*!
+ * Tunes to the given frequency after a delay
+ */
+void RadioEngineWrapperPrivate::tuneWithDelay( uint frequency, const int reason )
+{
+    if ( mEngineHandler->TunedFrequency() != frequency ) {
+        mTuneReason = reason;
+        mEngineHandler->TuneWithDelay( frequency );
+    }
+}
+
+/*!
+ *
+ */
+ObserverList& RadioEngineWrapperPrivate::observers()
+{
+    return mObservers;
+}
+
+/*!
+ *
+ */
+void RadioEngineWrapperPrivate::startSeeking( Seeking::Direction direction, const int reason )
+{
+    mTuneReason = reason;
+    mEngineHandler->Seek( direction );
+}
+
+/*!
+ * \reimp
+ */
+void RadioEngineWrapperPrivate::PowerEventL( TBool aPowerState, TInt DEBUGVAR( aError ) )
+{
+    LOG_FORMAT( "RadioEngineWrapperPrivate::PowerEventL, PowerState: %d, Error: %d", aPowerState, aError );
+    RUN_NOTIFY_LOOP( mObservers, radioStatusChanged( aPowerState ) );
+}
+
+/*!
+ * \reimp
+ */
+void RadioEngineWrapperPrivate::FrequencyEventL( TUint32 aFrequency,
+                                                 RadioEngine::TRadioFrequencyEventReason aReason,
+                                                 TInt aError )
+{
+    Q_UNUSED( aReason );
+    LOG_FORMAT( "RadioEngineWrapperPrivate::FrequencyEventL - Frequency: %d, Reason: %d, Error: %d", aFrequency, aReason, aError );
+
+    if ( !aError ) {
+        const uint frequency = static_cast<uint>( aFrequency );
+        RUN_NOTIFY_LOOP( mObservers, tunedToFrequency( frequency, mTuneReason ) );
+    }
+}
+
+/*!
+ * \reimp
+ */
+void RadioEngineWrapperPrivate::VolumeEventL( TInt aVolume, TInt aError )
+{
+    Q_UNUSED( aError );
+    RUN_NOTIFY_LOOP( mObservers, volumeChanged( aVolume ) );
+}
+
+/*!
+ * \reimp
+ */
+void RadioEngineWrapperPrivate::MuteEventL( TBool aMuteState, TInt aError )
+{
+    Q_UNUSED( aError );
+    RUN_NOTIFY_LOOP( mObservers, muteChanged( aMuteState ) );
+}
+
+/*!
+ * \reimp
+ */
+void RadioEngineWrapperPrivate::AudioModeEventL( TInt DEBUGVAR( aAudioMode ), TInt DEBUGVAR( aError ) )
+{
+    LOG_FORMAT( "RadioEngineWrapperPrivate::AudioModeEventL, AudioMode: %d, Error: %d", aAudioMode, aError );
+}
+
+/*!
+ * \reimp
+ */
+void RadioEngineWrapperPrivate::AntennaEventL( TBool aAntennaAttached, TInt aError )
+{
+    Q_UNUSED( aError );
+    RUN_NOTIFY_LOOP( mObservers, antennaStatusChanged( aAntennaAttached ) );
+}
+
+/*!
+ * \reimp
+ */
+void RadioEngineWrapperPrivate::AudioRoutingEventL( TInt aAudioDestination, TInt aError )
+{
+    Q_UNUSED( aAudioDestination )
+    Q_UNUSED( aError )
+}
+
+/*!
+ * \reimp
+ */
+void RadioEngineWrapperPrivate::SeekingEventL( TInt aSeekingState, TInt aError )
+{
+    Q_UNUSED( aSeekingState );
+    Q_UNUSED( aError );
+}
+
+/*!
+ * \reimp
+ */
+void RadioEngineWrapperPrivate::RegionEventL( TInt DEBUGVAR( aRegion ), TInt DEBUGVAR( aError ) )
+{
+    LOG_FORMAT( "RadioEngineWrapperPrivate::RegionEventL, aRegion: %d, Error: %d", aRegion, aError );
+}
+
+/*!
+ * \reimp
+ */
+void RadioEngineWrapperPrivate::AudioRouteChangedL( RadioEngine::TRadioAudioRoute aRoute )
+{
+    mUseLoudspeaker = aRoute == RadioEngine::ERadioSpeaker;
+    RUN_NOTIFY_LOOP( mObservers, audioRouteChanged( mUseLoudspeaker ) );
+}
+
+/*!
+ * \reimp
+ */
+void RadioEngineWrapperPrivate::HandleSystemEventL( TRadioSystemEventType DEBUGVAR( aEventType ) )
+{
+    LOG_FORMAT( "RadioEngineWrapperPrivate::HandleSystemEventL, Event: %d", aEventType );
+//    ERadioHeadsetConnected,         ///< Headset was connected
+//    ERadioHeadsetDisconnected,      ///< Headset was disconnected
+//    ERadioNetworkCoverageUp,        ///< Network coverage detected
+//    ERadioNetworkCoverageDown,      ///< Network coverage lost
+//    ERadioCallActivated,            ///< Call activated or ringing
+//    ERadioCallDeactivated,          ///< Call disconnected
+//    ERadioEmergencyCallActivated,   ///< Call activated or ringing
+//    ERadioEmergencyCallDeactivated, ///< Call disconnected
+//    ERadioLowDiskSpace,             ///< Low disk space
+//    ERadioAudioRoutingHeadset,      ///< Audio routed through headset
+//    ERadioAudioRoutingSpeaker,      ///< Audio routed through speaker ( IHF )
+//    ERadioAudioResourcesAvailable,  ///< Audio resources have become available
+//    ERadioAudioAutoResumeForbidden  ///< Audio auto resuming is forbidden
+}
+
+/*!
+ * \reimp
+ */
+void RadioEngineWrapperPrivate::HandleRepositoryValueChangeL( const TUid& aUid, TUint32 aKey, TInt aValue, TInt aError )
+{
+    if ( aUid == KCRUidProfileEngine && aKey == KProEngActiveProfile && !aError && aValue == KOfflineProfileId ) {
+        LOG( "RadioEngineWrapperPrivate::HandleRepositoryValueChangeL: Offline profile activated" );
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioenginewrapper/src/radioenginewrapper_win32.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,224 @@
+/*
+* 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:
+*
+*/
+
+// User includes
+#include "radioenginewrapper.h"
+#include "radioenginewrapper_win32_p.h"
+#include "radioenginewrapperobserver.h"
+
+/*!
+ * Constructor
+ */
+RadioEngineWrapper::RadioEngineWrapper( RadioStationHandlerIf& stationHandler ) :
+    d_ptr( new RadioEngineWrapperPrivate( this, stationHandler ) )
+{
+    Q_D( RadioEngineWrapper );
+    d->init();
+}
+
+/*!
+ * Destructor
+ */
+RadioEngineWrapper::~RadioEngineWrapper()
+{
+    delete d_ptr;
+}
+
+/*!
+ *
+ */
+void RadioEngineWrapper::addObserver( RadioEngineWrapperObserver* observer )
+{
+    Q_D( RadioEngineWrapper );
+    d->mObservers.append( observer );
+}
+
+/*!
+ *
+ */
+void RadioEngineWrapper::removeObserver( RadioEngineWrapperObserver* observer )
+{
+    Q_D( RadioEngineWrapper );
+    d->mObservers.removeAll( observer );
+}
+
+/*!
+ * Checks if the radio engine has been constructed properly
+ */
+bool RadioEngineWrapper::isEngineConstructed()
+{
+    Q_D( RadioEngineWrapper );
+    return d->isEngineConstructed();
+}
+
+/*!
+ * Returns the settings handler owned by the engine
+ */
+RadioSettingsIf& RadioEngineWrapper::settings()
+{
+    Q_D( RadioEngineWrapper );
+    return d->settings();
+}
+
+/*!
+ * Returns the selected radio region
+ */
+RadioRegion::Region RadioEngineWrapper::region() const
+{
+    Q_D( const RadioEngineWrapper );
+    return d->mRegionId;
+}
+
+/*!
+ * Returns the minimum frequency
+ */
+uint RadioEngineWrapper::minFrequency() const
+{
+    Q_D( const RadioEngineWrapper );
+    return d->mMinFrequency;
+}
+
+/*!
+ * Returns the maximum frequency
+ */
+uint RadioEngineWrapper::maxFrequency() const
+{
+    Q_D( const RadioEngineWrapper );
+    return d->mMaxFrequency;
+}
+
+/*!
+ * Returns the frequency step size from the selected region
+ */
+uint RadioEngineWrapper::frequencyStepSize() const
+{
+    Q_D( const RadioEngineWrapper );
+    return d->mFrequencyStepSize;
+}
+
+/*!
+ * Returns the frequency step size from the selected region
+ */
+bool RadioEngineWrapper::isFrequencyValid( uint frequency )
+{
+    Q_UNUSED( frequency );
+    return true;
+}
+
+/*!
+ * Checks if the radio engine is on
+ */
+bool RadioEngineWrapper::isRadioOn() const
+{
+    return true;
+}
+
+/*!
+ * Returns the currently tuned frequency
+ */
+uint RadioEngineWrapper::currentFrequency() const
+{
+    Q_D( const RadioEngineWrapper );
+    return d->mFrequency;
+}
+
+/*!
+ * Returns the mute status
+ */
+bool RadioEngineWrapper::isMuted() const
+{
+    return false;
+}
+
+/*!
+ * Returns the antenna connection status
+ */
+bool RadioEngineWrapper::isAntennaAttached() const
+{
+    Q_D( const RadioEngineWrapper );
+    return d->mAntennaAttached;
+}
+
+/*!
+ * Returns the "use loudspeaker" status
+ */
+bool RadioEngineWrapper::isUsingLoudspeaker() const
+{
+    Q_D( const RadioEngineWrapper );
+    return d->mUseLoudspeaker;
+}
+
+/*!
+ * Tunes to the given frequency
+ */
+void RadioEngineWrapper::tuneFrequency( uint frequency, const int sender )
+{
+    Q_D( RadioEngineWrapper );
+    d->tuneFrequency( frequency, sender );
+}
+
+/*!
+ * Tunes to the given frequency after a delay
+ */
+void RadioEngineWrapper::tuneWithDelay( uint frequency, const int sender )
+{
+    Q_D( RadioEngineWrapper );
+    d->tuneWithDelay( frequency, sender );
+}
+
+/*!
+ * volume update command for the engine
+ */
+void RadioEngineWrapper::setVolume( int volume )
+{
+    Q_D( RadioEngineWrapper );
+    d->setVolume( volume );
+}
+
+/*!
+ *
+ */
+void RadioEngineWrapper::setMute( bool muted )
+{
+}
+
+/*!
+ *
+ */
+void RadioEngineWrapper::toggleAudioRoute()
+{
+    Q_D( RadioEngineWrapper );
+    d->toggleAudioRoute();
+}
+
+/*!
+ *
+ */
+void RadioEngineWrapper::startSeeking( Seeking::Direction direction, const int reason )
+{
+    Q_D( RadioEngineWrapper );
+    d->startSeeking( direction, reason );
+}
+
+/*!
+ *
+ */
+void RadioEngineWrapper::cancelSeeking()
+{
+    Q_D( RadioEngineWrapper );
+    d->cancelSeeking();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioenginewrapper/src/radioenginewrapper_win32_p.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,339 @@
+/*
+* 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:
+*
+*/
+
+// System includes
+#include <QTimer>
+#include <QSettings>
+
+// User includes
+#include "radioenginewrapper_win32_p.h"
+#include "radiosettings.h"
+#include "radiosettings_p.h"
+#include "radiologger.h"
+#include "radio_global.h"
+#include "radiostationhandlerif.h"
+#include "radioenginewrapperobserver.h"
+//#include "t_radiodataparser.h"
+
+static RadioEngineWrapperPrivate* theInstance = 0;
+
+const QString KKeyFrequency = "CurrentFreq";
+const QString KKeyOffline = "Offline";
+
+const uint KScanFrequencies[] = {
+    87600000,
+    88000000,
+    89400000,
+    96000000,
+    97600000,
+    100600000,
+    101300000,
+    102600000,
+    103500000,
+    104100000,
+    105500000,
+    107500000
+};
+
+const int KScanFrequencyCount = sizeof( KScanFrequencies ) / sizeof( KScanFrequencies[0] );
+
+/*!
+ *
+ */
+RadioEngineWrapperPrivate::RadioEngineWrapperPrivate( RadioEngineWrapper* wrapper,
+                                                      RadioStationHandlerIf& stationHandler ) :
+    q_ptr( wrapper ),
+    mStationHandler( stationHandler ),
+    mTuneTimer( new QTimer( this ) ),
+    mTuneReason( 0 ),
+    mUseLoudspeaker( false ),
+    mAntennaAttached( true ),
+    mFrequency( 0 ),
+    mNextFrequency( 0 ),
+    mVolume( 5 ),
+    mMaxVolume( 10000 ),
+    mFrequencyStepSize( 50000 ),
+    mRegionId( RadioRegion::Default ),
+    mMinFrequency( 87500000 ),
+    mMaxFrequency( 108000000 )
+{
+    ::theInstance = this;
+    mEngineSettings.reset( new QSettings( "Nokia", "QtFmRadio" ) );
+    mFrequency = mEngineSettings->value( KKeyFrequency ).toUInt();
+    if ( mFrequency == 0 ) {
+        mFrequency = mMinFrequency;
+    }
+
+    connectAndTest( mTuneTimer, SIGNAL(timeout()), this, SLOT(frequencyEvent()) );
+    mTuneTimer->setSingleShot( true );    
+}
+
+/*!
+ *
+ */
+RadioEngineWrapperPrivate::~RadioEngineWrapperPrivate()
+{
+    // Destructor needs to be defined because some member variables that are forward declared
+    // in the header are managed by QT's smart pointers and they require that the owning class
+    // has a non-inlined destructor. Compiler generates an inlined destructor if it isn't defined.
+}
+
+/*!
+ *
+ */
+RadioEngineWrapperPrivate* RadioEngineWrapperPrivate::instance()
+{
+    return ::theInstance;
+}
+
+/*!
+ * Initializes the private implementation
+ */
+void RadioEngineWrapperPrivate::init()
+{
+    mUseLoudspeaker = false;
+    if ( !mUseLoudspeaker ) {
+        RUN_NOTIFY_LOOP( mObservers, audioRouteChanged( false ) );
+    }
+
+    parseData();
+}
+
+/*!
+ * Starts up the radio engine
+ */
+bool RadioEngineWrapperPrivate::isEngineConstructed()
+{
+    return true;
+}
+
+/*!
+ * Returns the settings handler owned by the engine
+ */
+RadioSettingsIf& RadioEngineWrapperPrivate::settings()
+{
+    if ( !mSettings ) {
+        mSettings.reset( new RadioSettings() );
+//        mSettings->d_func()->init( &mEngineHandler->ApplicationSettings() );
+    }
+    return *mSettings;
+}
+
+/*!
+ * Tunes to the given frequency
+ */
+void RadioEngineWrapperPrivate::tuneFrequency( uint frequency, const int reason )
+{
+    mNextFrequency = frequency;
+    mTuneReason = reason;
+    mTuneTimer->stop();
+    mTuneTimer->start( 500 );
+}
+
+/*!
+ * Tunes to the given frequency after a delay
+ */
+void RadioEngineWrapperPrivate::tuneWithDelay( uint frequency, const int reason )
+{
+    mNextFrequency = frequency;
+    mTuneReason = reason;
+    mTuneTimer->stop();
+    mTuneTimer->start( 1500 );
+}
+
+/*!
+ *
+ */
+ObserverList& RadioEngineWrapperPrivate::observers()
+{
+    return mObservers;
+}
+
+/*!
+ *
+ */
+void RadioEngineWrapperPrivate::startSeeking( Seeking::Direction direction, const int reason )
+{
+    mTuneReason = reason;
+
+    // Find the previous and next favorite from current frequency
+    uint previous = 0;
+    uint next = 0;
+    for( int i = 0; i < KScanFrequencyCount; ++i ) {
+        const uint testFreq = KScanFrequencies[i];
+        if ( KScanFrequencies[i] > mFrequency ) {
+            next = testFreq;
+            break;
+        }
+        previous = testFreq;
+    }
+
+
+    if ( direction == Seeking::Up ) {
+        if ( next == 0 ) {
+            next = KScanFrequencies[0];
+        }
+        mNextFrequency = next;
+    } else {
+        if ( previous == 0 ) {
+            previous = KScanFrequencies[KScanFrequencyCount - 1];
+        }
+        mNextFrequency = previous;
+    }
+
+    mTuneTimer->start( 1000 );
+}
+
+/*!
+ *
+ */
+void RadioEngineWrapperPrivate::cancelSeeking()
+{
+    mTuneTimer->stop();
+    mNextFrequency = 0;
+}
+
+/*!
+ *
+ */
+void RadioEngineWrapperPrivate::toggleAudioRoute()
+{
+    mUseLoudspeaker = !mUseLoudspeaker;
+    RUN_NOTIFY_LOOP( mObservers, audioRouteChanged( mUseLoudspeaker ) );
+}
+
+/*!
+ *
+ */
+QString RadioEngineWrapperPrivate::dataParsingError() const
+{
+    return mParsingError;
+}
+
+/*!
+ *
+ */
+void RadioEngineWrapperPrivate::setHeadsetStatus( bool connected )
+{
+    mAntennaAttached = connected;
+    RUN_NOTIFY_LOOP( mObservers, antennaStatusChanged( mAntennaAttached ) );
+}
+
+/*!
+ *
+ */
+void RadioEngineWrapperPrivate::setVolume( int volume )
+{
+    mVolume = volume;
+    RUN_NOTIFY_LOOP( mObservers, volumeChanged( mVolume ) );
+}
+
+/*!
+ *
+ */
+void RadioEngineWrapperPrivate::addSong( const QString& artist, const QString& title )
+{
+    QString radioText = QString( "Now Playing: %1 - %2" ).arg( artist ).arg( title );
+    mArtist = artist;
+    mTitle = title;
+
+    const uint frequency = mStationHandler.currentFrequency();
+    mStationHandler.setCurrentRadioText( frequency, radioText );
+
+    QTimer::singleShot( 500, this, SLOT(addSongTags()) );
+}
+
+/*!
+ *
+ */
+void RadioEngineWrapperPrivate::clearSong()
+{
+    mStationHandler.setCurrentRadioText( mStationHandler.currentFrequency(), "" );
+}
+
+/*!
+ *
+ */
+bool RadioEngineWrapperPrivate::isOffline() const
+{
+    return mEngineSettings->value( KKeyOffline, false ).toBool();
+}
+
+/*!
+ *
+ */
+void RadioEngineWrapperPrivate::setOffline( bool offline )
+{
+    mEngineSettings->setValue( KKeyOffline, offline );
+}
+
+/*!
+ * Private slot
+ */
+void RadioEngineWrapperPrivate::frequencyEvent()
+{
+    mFrequency = mNextFrequency;
+    mEngineSettings->setValue( KKeyFrequency, mFrequency );
+
+    RUN_NOTIFY_LOOP( mObservers, tunedToFrequency( mFrequency, mTuneReason ) );
+}
+
+/*!
+ * Private slot
+ */
+void RadioEngineWrapperPrivate::addSongTags()
+{
+    const uint frequency = mStationHandler.currentFrequency();
+    mStationHandler.setCurrentRadioTextPlus( frequency, RtPlus::Artist, mArtist );
+    mStationHandler.setCurrentRadioTextPlus( frequency, RtPlus::Title, mTitle );
+    mArtist = "";
+    mTitle = "";
+}
+
+/*!
+ *
+ */
+void RadioEngineWrapperPrivate::parseData()
+{
+    /*
+    mDataParser.reset( new T_RadioDataParser() );
+    bool ok = mDataParser->parse();
+    if ( !ok ) {
+        mParsingError = mDataParser->errorString();
+    } else {
+        if ( mDataParser->mEngineSettings.mMaxVolume > 0 ) {
+            mMaxVolume = mDataParser->mEngineSettings.mMaxVolume;
+        }
+
+        if ( mDataParser->mEngineSettings.mFrequencyStepSize > 0 ) {
+            mFrequencyStepSize = mDataParser->mEngineSettings.mFrequencyStepSize;
+        }
+
+        if ( mDataParser->mEngineSettings.mRegionId >= 0 ) {
+            mRegionId = static_cast<RadioRegion::Region>( mDataParser->mEngineSettings.mRegionId );
+        }
+
+        if ( mDataParser->mEngineSettings.mMinFrequency > 0 ) {
+            mMinFrequency = mDataParser->mEngineSettings.mMinFrequency;
+        }
+
+        if ( mDataParser->mEngineSettings.mMaxFrequency > 0 ) {
+            mMaxFrequency = mDataParser->mEngineSettings.mMaxFrequency;
+        }
+    }
+*/
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioenginewrapper/src/radioenginewrapperobserver.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,107 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "radioenginewrapperobserver.h"
+
+/*!
+ *
+ * @param frequency
+ * @param commandSender
+ */
+void RadioEngineWrapperObserver::tunedToFrequency( uint frequency, int reason )
+{
+    // Default implementation does nothing
+    Q_UNUSED( frequency );
+    Q_UNUSED( reason );
+}
+
+/*!
+ *
+ * @param radioIsOn
+ */
+void RadioEngineWrapperObserver::radioStatusChanged( bool radioIsOn )
+{
+    // Default implementation does nothing
+    Q_UNUSED( radioIsOn );
+}
+
+/*!
+ *
+ * @param available
+ */
+void RadioEngineWrapperObserver::rdsAvailabilityChanged( bool available )
+{
+    // Default implementation does nothing
+    Q_UNUSED( available );
+}
+
+/*!
+ *
+ * @param volume
+ */
+void RadioEngineWrapperObserver::volumeChanged( int volume )
+{
+    // Default implementation does nothing
+    Q_UNUSED( volume );
+}
+
+/*!
+ *
+ * @param muted
+ */
+void RadioEngineWrapperObserver::muteChanged( bool muted )
+{
+    // Default implementation does nothing
+    Q_UNUSED( muted );
+}
+
+/*!
+ *
+ * @param loudspeaker
+ */
+void RadioEngineWrapperObserver::audioRouteChanged( bool loudspeaker )
+{
+    // Default implementation does nothing
+    Q_UNUSED( loudspeaker );
+}
+
+/*!
+ *
+ * @param connected
+ */
+void RadioEngineWrapperObserver::antennaStatusChanged( bool connected )
+{
+    // Default implementation does nothing
+    Q_UNUSED( connected );
+}
+
+/*!
+ *
+ */
+void RadioEngineWrapperObserver::skipPrevious()
+{
+    // Default implementation does nothing
+}
+
+/*!
+ *
+ */
+void RadioEngineWrapperObserver::skipNext()
+{
+    // Default implementation does nothing
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioenginewrapper/src/radiologger.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,202 @@
+/*
+* 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:
+*
+*/
+
+// System includes
+#include <QDebug>
+
+// User includes
+#include "radiologger.h"
+
+/*!
+ *
+ */
+void RadioLogger::initCombinedLogger()
+{
+#if defined LOGGING_ENABLED && defined COMBINE_WITH_ENGINE_LOGGER && !defined BUILD_WIN32
+    TRAP_IGNORE( RadioEngineUtils::InitializeL() );
+    if ( !MRadioEngineLogger::Logger() ) {
+        qDebug() << "FMRadioUi: Cannot combine logs with engine. Engine logger not active";
+    }
+#endif // LOGGING_ENABLED
+}
+
+/*!
+ *
+ */
+void RadioLogger::releaseCombinedLogger()
+{
+#if defined LOGGING_ENABLED && defined COMBINE_WITH_ENGINE_LOGGER && !defined BUILD_WIN32
+    RadioEngineUtils::Release();
+#endif // LOGGING_ENABLED
+}
+
+/*!
+ *    enum Mode { Normal, MethodEnter, MethodExit, DecIndent };
+ */
+void RadioLogger::logMsg( const char* msg, Mode mode )
+{
+    Q_UNUSED( msg );
+    Q_UNUSED( mode );
+#if defined LOGGING_ENABLED && defined COMBINE_WITH_ENGINE_LOGGER && !defined BUILD_WIN32
+    MRadioEngineLogger* logger = MRadioEngineLogger::Logger();
+    if ( logger ) {
+        if ( mode == RadioLogger::Normal ) {
+            logger->AddIndent(KMarkerUi()).Add( msg ).Commit();
+        } else if ( mode == RadioLogger::MethodEnter ) {
+            logger->AddIndentClear( KMarkerUi() ).Add( msg ).Commit();
+            logger->IncIndent();
+        } else if ( mode == RadioLogger::MethodExit ) {
+            logger->DecIndent();
+            logger->AddIndentClear( KMarkerUi() ).Add( msg ).Commit();
+        } else if ( mode == RadioLogger::DecIndent ) {
+            logger->DecIndent();
+        } else {}
+    }
+#endif // LOGGING_ENABLED
+}
+
+
+#ifdef LOGGING_ENABLED
+
+#include <QString>
+#include <QFile>
+#include <QTextStream>
+#include <QDateTime>
+
+#ifdef TRACE_TO_FILE
+    QFile mDebugFile;
+    bool mFilterByLogMarker = false;
+#endif
+
+const char* KLogEnter = "\\ %s";
+const char* KLogExit = "/ %s";
+const char* KLogExitRet = "/ %s, Returning %s";
+const char* KLogExitException = "/ %s, Exception raised";
+const char* KLogLine = "| ";
+
+/*!
+ *
+ */
+static QString formatString( const char* format, long val )
+{
+    if ( strcmp( format, "" ) == 0 ) {
+        return "";
+    }
+    QString string;
+    string.sprintf( format, val );
+    return string;
+}
+
+/*!
+ *
+ */
+MethodLogger::MethodLogger( const char* function, const char* format ) :
+    mFunction( function ),
+    mFormat( format )
+{
+    QString msg;
+    msg.sprintf( KLogEnter, mFunction );
+    WRITELOG_METHOD_ENTER( msg );
+}
+
+/*!
+ *
+ */
+MethodLogger::~MethodLogger()
+{
+    if ( std::uncaught_exception() ) {
+        QString msg;
+        msg.sprintf( KLogExitException, mFunction );
+        WRITELOG_METHOD_EXIT( msg );
+    } else {
+        QString msg;
+        if ( strlen( mFormat ) > 0 ) {
+            #if defined(__WINS__)
+
+                long retVal = 0;
+                _asm( mov retVal, ebx );
+                msg.sprintf( KLogExitRet, mFunction, formatString( mFormat, retVal ) );
+                WRITELOG_METHOD_EXIT( msg );
+
+            #else
+                msg.sprintf( KLogExit, mFunction );
+                WRITELOG_METHOD_EXIT( msg );
+            #endif
+        } else {
+            msg.sprintf( KLogExit, mFunction );
+            WRITELOG_METHOD_EXIT( msg );
+        }
+    }
+}
+#else
+
+MethodLogger::MethodLogger( const char*, const char* )
+{
+}
+        
+MethodLogger::~MethodLogger()
+{
+}
+
+#endif // LOGGING_ENABLED
+
+
+#ifdef TRACE_TO_FILE
+
+/*!
+ *
+ */
+void FileLogger::installMessageHandler( const QString& fileName, bool filterByMarker )
+{
+    mDebugFile.setFileName( fileName );
+    mFilterByLogMarker = filterByMarker;
+
+    mDebugFile.open( QIODevice::Text | QIODevice::WriteOnly );
+
+    if ( mDebugFile.isOpen() ) {
+        qInstallMsgHandler( FileLogger::handleMessage );
+    }
+}
+
+/*!
+ *
+ */
+void FileLogger::uninstallMessageHandler()
+{
+    if ( mDebugFile.isOpen() ) {
+        qInstallMsgHandler( 0 );
+        mDebugFile.close();
+    }
+}
+
+/*!
+ *
+ */
+void FileLogger::handleMessage( QtMsgType type, const char* msg )
+{
+    QTextStream debugStream( &mDebugFile );
+    QDateTime dateTime( QDateTime::currentDateTime() );
+
+    if ( type == QtDebugMsg ) {
+        QString message( msg );
+        if ( mFilterByLogMarker && message.contains( QString( LOGMARKER ) ) )
+        {
+            debugStream << dateTime.toString("yyyy-MM-dd hh:mm:ss.zzz") << " : " << message << endl;
+        }
+    }
+}
+#endif // TRACE_TO_FILE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioenginewrapper/src/radiordslistener.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,129 @@
+/*
+* 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:
+*
+*/
+
+// User includes
+#include "radiordslistener.h"
+#include "radiostationhandlerif.h"
+#include "radioenginewrapper_p.h"
+#include "radioenginewrapperobserver.h"
+#include "radiologger.h"
+
+/*!
+ * Converts a symbian descriptor to Qt string
+ */
+static QString convertString( const TDesC& aDesc )
+{
+    return QString( (QChar*)aDesc.Ptr(), aDesc.Length() );
+}
+
+/*!
+ *
+ */
+RadioRdsListener::RadioRdsListener( RadioStationHandlerIf& stationHandler, RadioEngineWrapperPrivate& wrapper ) :
+    mStationHandler( stationHandler ),
+    mWrapper( wrapper )
+{
+}
+
+/*!
+ * \reimp
+ */
+void RadioRdsListener::RdsAvailable( TUint32 /*aFrequency*/, TBool aAvailable )
+{
+    RUN_NOTIFY_LOOP( mWrapper.observers(), rdsAvailabilityChanged( aAvailable ) );
+}
+
+/*!
+ * \reimp
+ */
+void RadioRdsListener::RdsAfSearchBegin()
+{
+}
+
+/*!
+ * \reimp
+ */
+void RadioRdsListener::RdsAfSearchEnd( TUint32 /*aFrequency*/, TInt /*aError*/ )
+{
+}
+
+/*!
+ * \reimp
+ */
+void RadioRdsListener::RdsAfSearchStateChange( TBool /*aEnabled*/ )
+{
+}
+
+/*!
+ * \reimp
+ */
+void RadioRdsListener::RdsDataProgrammeService( TUint32 aFrequency, const TDesC& aProgramService )
+{
+    if ( aProgramService.Length() > 0 ) {
+        LOG_TIMESTAMP( "RdsName changed" );
+        const uint frequency = static_cast<uint>( aFrequency );
+        mStationHandler.setCurrentPsName( frequency, convertString( aProgramService ) );
+
+#ifdef SHOW_CALLSIGN_IN_ANY_REGION
+        RdsDataPiCode( frequency, 0x3BB7 ); //KQOL-FM - Las Vegas, NV
+#endif
+    }
+}
+
+/*!
+ * \reimp
+ */
+void RadioRdsListener::RdsDataRadioText( TUint32 aFrequency, const TDesC& aRadioText )
+{
+    if ( aRadioText.Length() > 0 ) {
+        const uint frequency = static_cast<uint>( aFrequency );
+        mStationHandler.setCurrentRadioText( frequency, convertString( aRadioText ) );
+    }
+}
+
+/*!
+ * \reimp
+ */
+void RadioRdsListener::RdsDataRadioTextPlus( TUint32 aFrequency,
+                                             const TInt aRadioTextPlusClass,
+                                             const TDesC& aRadioText )
+{
+    if ( aRadioText.Length() > 0 ) {
+        const uint frequency = static_cast<uint>( aFrequency );
+        mStationHandler.setCurrentRadioTextPlus( frequency, aRadioTextPlusClass, convertString( aRadioText ) );
+    }
+}
+
+/*!
+ * \reimp
+ */
+void RadioRdsListener::RdsDataGenre( TUint32 aFrequency, const TInt aGenre )
+{
+    LOG_FORMAT( "RadioRdsListener::RdsDataGenre: Genre: %d", aGenre );
+    const uint frequency = static_cast<uint>( aFrequency );
+    mStationHandler.setCurrentGenre( frequency, aGenre );
+}
+
+/*!
+ * \reimp
+ */
+void RadioRdsListener::RdsDataPiCode( TUint32 aFrequency, const TInt aPiCode )
+{
+    LOG_FORMAT( "RadioRdsListener::RdsDataPiCode, PI: %d", aPiCode );
+    const uint frequency = static_cast<uint>( aFrequency );
+    mStationHandler.setCurrentPiCode( frequency, aPiCode );
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioenginewrapper/src/radiosettings.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// System includes
+#include <QVariant>
+
+// User includes
+#include "radiosettings.h"
+#include "radiosettings_p.h"
+#include "radio_global.h"
+
+namespace RadioSetting
+{
+    enum TMtvSettingType
+    {
+        EFlags = 0,
+        ESomething
+    };
+}
+
+/*!
+ *
+ */
+RadioSettings::RadioSettings() :
+    d_ptr( new RadioSettingsPrivate( this ) )
+{
+}
+
+/*!
+ *
+ */
+RadioSettings::~RadioSettings()
+{
+    delete d_ptr;
+}
+
+/*!
+ * \reimp
+ */
+bool RadioSettings::isFirstTimeStart()
+{
+    Q_D( RadioSettings );
+    return d->isFirstTimeStart();
+}
+
+/*!
+ * \reimp
+ */
+bool RadioSettings::showFavorites() const
+{
+    Q_D( const RadioSettings );
+    return d->isFlagSet( RadioSettingsPrivate::EShowFavorites );
+}
+
+/*!
+ * \reimp
+ */
+void RadioSettings::setShowFavorites( bool showFavorites )
+{
+    Q_D( RadioSettings );
+    if ( d->isFlagSet( RadioSettingsPrivate::EShowFavorites ) != showFavorites ) {
+        d->toggleFlag( RadioSettingsPrivate::EShowFavorites );
+    }
+}
+
+/*!
+ * \reimp
+ */
+bool RadioSettings::toggleShowFavorites()
+{
+    Q_D( RadioSettings );
+    d->toggleFlag( RadioSettingsPrivate::EShowFavorites );
+    return d->isFlagSet( RadioSettingsPrivate::EShowFavorites );
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioenginewrapper/src/radiosettings_p.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,85 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "radiosettings.h"
+#include "radiosettings_p.h"
+#include "mradioapplicationsettings.h"
+
+
+/*!
+ *
+ */
+RadioSettingsPrivate::RadioSettingsPrivate( RadioSettings* settingsPublic ) :
+    q_ptr( settingsPublic ),
+    mFlags( 0 )
+{
+}
+
+/*!
+ *
+ */
+RadioSettingsPrivate::~RadioSettingsPrivate()
+{
+}
+
+/*!
+ *
+ */
+void RadioSettingsPrivate::init( MRadioApplicationSettings* storage )
+{
+    mSettingsStorage = storage;
+    if ( mSettingsStorage ) {
+        mFlags = Toggles( mSettingsStorage->UiFlags() );
+    }
+}
+
+/*!
+ *
+ */
+bool RadioSettingsPrivate::isFirstTimeStart()
+{
+    if ( mSettingsStorage ) {
+        return mSettingsStorage->UpdateStartCount() == 0;
+    }
+    return false;
+}
+
+/*!
+ *
+ */
+bool RadioSettingsPrivate::isFlagSet( ToggleFlag flag ) const
+{
+    return mFlags.testFlag( flag );
+}
+
+/*!
+ *
+ */
+void RadioSettingsPrivate::toggleFlag( ToggleFlag flag )
+{
+    mFlags ^= flag;
+}
+
+/*!
+ *
+ */
+void RadioSettingsPrivate::saveFlags()
+{
+    if ( mSettingsStorage ) {
+        mSettingsStorage->SetUiFlags( mFlags );
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioenginewrapper/src/radiosettings_win32_p.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "radiosettings.h"
+#include "radiosettings_p.h"
+
+
+/*!
+ *
+ */
+RadioSettingsPrivate::RadioSettingsPrivate( RadioSettings* settingsPublic ) :
+    q_ptr( settingsPublic ),
+    mFlags( 0 )
+{
+}
+
+/*!
+ *
+ */
+RadioSettingsPrivate::~RadioSettingsPrivate()
+{
+}
+
+/*!
+ *
+ */
+/*
+void RadioSettingsPrivate::init( MRadioApplicationSettings* storage )
+{
+    mSettingsStorage = storage;
+    if ( mSettingsStorage ) {
+        mFlags = Toggles( mSettingsStorage->UiFlags() );
+    }
+}
+*/
+/*!
+ *
+ */
+bool RadioSettingsPrivate::isFirstTimeStart()
+{
+    return false;
+}
+
+/*!
+ *
+ */
+bool RadioSettingsPrivate::isFlagSet( ToggleFlag flag ) const
+{
+    return mFlags.testFlag( flag );
+}
+
+/*!
+ *
+ */
+void RadioSettingsPrivate::toggleFlag( ToggleFlag flag )
+{
+    mFlags ^= flag;
+}
+
+/*!
+ *
+ */
+void RadioSettingsPrivate::saveFlags()
+{
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radioenginewrapper/src/t_radiodataparser.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,601 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "t_radiodataparser.h"
+
+const int KThousand                     = 1000;
+const int KMillion                      = KThousand * KThousand;
+
+const QString KDataFile                 = "./settings.xml";
+
+const QString KXmlMilliseconds          = "ms";
+const QString KXmlSeconds               = "s";
+const QString KXmlMinutes               = "m";
+const QString KXmlRadioSettings         = "RadioSettings";
+const QString KXmlMaxVolume             = "maxvolume";
+const QString KXmlFrequencyStepSize     = "FrequencyStepSize";
+const QString KXmlRegion                = "region";
+const QString KXmlMinFrequency          = "MinFrequency";
+const QString KXmlMaxFrequency          = "MaxFrequency";
+
+const QString KXmlRadioStations         = "RadioStations";
+const QString KXmlSetting               = "setting";
+const QString KXmlStation               = "Station";
+const QString KXmlName                  = "name";
+const QString KXmlValue                 = "value";
+const QString KXmlFrequency             = "frequency";
+const QString KXmlBooleanTrue           = "TRUE";
+const QString KXmlRds                   = "Rds";
+const QString KXmlRdsItem               = "RdsItem";
+const QString KXmlInterval              = "SendInterval";
+const QString KXmlType                  = "type";
+const QString KXmlCount                 = "count";
+const QString KXmlDelay                 = "delay";
+
+const QString KXmlRdsGroup              = "RdsGroup";
+const QString KXmlRdsPsName             = "PsName";
+const QString KXmlRdsPiCode             = "PiCode";
+const QString KXmlRdsRt                 = "RT";
+const QString KXmlRdsRtPlus             = "RtPlus";
+const QString KXmlRdsRtPlusItem         = "RtPlusItem";
+const QString KXmlRdsRtPlusTag          = "RtPlusTag";
+const QString KXmlRdsRtPlusTagDelay     = "delay";
+const QString KXmlRdsRtPlusTagArtist    = "artist";
+const QString KXmlRdsRtPlusTagTitle     = "title";
+const QString KXmlRdsPty                = "Pty";
+
+/*!
+ *
+ */
+static bool isEqual( const QString& first, const QString& second )
+{
+    return first.compare( second, Qt::CaseInsensitive ) == 0;
+}
+
+
+/*!
+ *
+ */
+T_RadioDataParser::T_RadioDataParser() :
+    mReader( new QXmlSimpleReader() )
+{
+}
+
+/*!
+ *
+ */
+T_RadioDataParser::~T_RadioDataParser()
+{
+}
+
+/*!
+ *
+ */
+bool T_RadioDataParser::parse()
+{
+    QFile file( KDataFile );
+    if ( file.exists() ) {
+        mSource.reset( new QXmlInputSource( &file ) );
+        mReader->setContentHandler( this );;
+        mReader->setErrorHandler( this );
+
+        return mReader->parse( mSource.data() );
+    } else {
+        mErrorString = QString( "Data file %1 not found!" ).arg( file.fileName() );
+    }
+    return false;
+}
+
+/*!
+ * \reimp
+ */
+bool T_RadioDataParser::startDocument()
+{
+    return true;
+}
+
+/*!
+ * \reimp
+ */
+bool T_RadioDataParser::endDocument()
+{
+    return true;
+}
+
+/*!
+ * \reimp
+ */
+bool T_RadioDataParser::startElement( const QString& namespaceURI,
+                                      const QString& localName,
+                                      const QString& qName,
+                                      const QXmlAttributes& atts )
+{
+    if ( isEqual( localName, KXmlRadioSettings ) )
+    {
+        handleStartRadioSettings( atts );
+    }
+    else if ( isEqual( localName, KXmlSetting ) )
+    {
+        handleStartSetting( atts );
+    }
+    else if ( isEqual( localName, KXmlRadioStations ) )
+    {
+//        handleStartRdsData( atts );
+    }
+    else if ( isEqual( localName, KXmlStation ) )
+    {
+        handleStartStation( atts );
+    }
+    else if ( isEqual( localName, KXmlRdsGroup ) )
+    {
+        handleStartRdsGroup( atts );
+    }
+    else if ( isEqual( localName, KXmlRds ) )
+    {
+        handleStartRdsData( atts );
+    }
+
+    return true;
+}
+
+/*!
+ * \reimp
+ */
+bool T_RadioDataParser::endElement( const QString& namespaceURI, const QString& localName, const QString& qName )
+{
+    if ( isEqual( localName, KXmlRadioSettings ) )
+        {
+        handleEndRadioSettings();
+        }
+    else if ( isEqual( localName, KXmlSetting ) )
+        {
+        handleEndSetting();
+        }
+    else if ( isEqual( localName, KXmlStation ) )
+        {
+        handleEndStation();
+        }
+    else if ( isEqual( localName, KXmlRds ) )
+        {
+        handleEndRdsData();
+        }
+    return true;
+}
+
+/*!
+ * \reimp
+ */
+bool T_RadioDataParser::characters( const QString& ch )
+{
+    return true;
+}
+
+/*!
+ * \reimp
+ */
+bool T_RadioDataParser::error( const QXmlParseException& exception )
+{
+    mErrorString = QString( "Line: %1, Column: %2, Msg: %3" )
+                   .arg( exception.lineNumber() )
+                   .arg( exception.columnNumber() )
+                   .arg( exception.message() );
+    return true;
+}
+
+/*!
+ * \reimp
+ */
+bool T_RadioDataParser::fatalError( const QXmlParseException& exception )
+{
+    mErrorString = QString( "Error in data XML. Line: %1, Column: %2, Msg: %3" )
+                   .arg( exception.lineNumber() )
+                   .arg( exception.columnNumber() )
+                   .arg( exception.message() );
+    return false;
+}
+
+/*!
+ * \reimp
+ */
+QString T_RadioDataParser::errorString() const
+{
+    return mErrorString;
+}
+
+/*!
+ *
+ */
+void T_RadioDataParser::handleStartRadioSettings( const QXmlAttributes& atts )
+{
+    Q_UNUSED( atts );
+    RadioData::EngineSettings* engineSettings = new RadioData::EngineSettings;
+    pushToSettingStack( engineSettings, mSettingStack );
+}
+
+/*!
+ *
+ */
+void T_RadioDataParser::handleEndRadioSettings()
+{
+    RadioData::EngineSettings* engineSettings
+            = static_cast<RadioData::EngineSettings*>( popFromSettingStack( mSettingStack ) );
+    if ( engineSettings )
+    {
+        mEngineSettings = *engineSettings;
+        delete engineSettings;
+        engineSettings = 0;
+    }
+}
+
+/*!
+ *
+ */
+void T_RadioDataParser::handleStartSetting( const QXmlAttributes& atts )
+{
+    RadioData::SettingHolder* holder = new RadioData::SettingHolder;
+
+    RadioData::Setting* parentHolder = topOfSettingStack( mSettingHolderStack );
+    if ( parentHolder ) {
+        static_cast<RadioData::SettingHolder*>( parentHolder )->mChildren.append( holder );
+    }
+
+    pushToSettingStack( holder, mSettingHolderStack );
+
+    for ( int i = 0; i < atts.count(); ++i )
+    {
+        QString attrName = atts.localName( i );
+
+        if ( isEqual( attrName, KXmlName ) )
+        {
+            holder->mName = atts.value( i );
+        }
+        else if ( isEqual( attrName, KXmlValue ) == 0 )
+        {
+            holder->mValue = atts.value( i );
+        }
+    }
+}
+
+/*!
+ *
+ */
+void T_RadioDataParser::handleEndSetting()
+{
+    QScopedPointer<RadioData::SettingHolder> holder(
+            static_cast<RadioData::SettingHolder*>( popFromSettingStack( mSettingHolderStack ) ) );
+    if ( mSettingHolderStack.count() == 0 )
+    {
+        if ( RadioData::Setting* setting = topOfSettingStack( mSettingStack ) )
+        {
+            setting->setValue( *holder, *this );
+        }
+    }
+}
+
+/*!
+ *
+ */
+void T_RadioDataParser::handleStartStation( const QXmlAttributes& atts )
+{
+    RadioData::Station* station = new RadioData::Station;
+    pushToSettingStack( station, mSettingStack );
+}
+
+/*!
+ *
+ */
+void T_RadioDataParser::handleEndStation()
+{
+    RadioData::Station* station = static_cast<RadioData::Station*>( popFromSettingStack( mSettingStack ) );
+    mStations.append( station );
+}
+
+/*!
+ *
+ */
+void T_RadioDataParser::handleStartRdsGroup( const QXmlAttributes& atts )
+{
+
+}
+
+/*!
+ *
+ */
+void T_RadioDataParser::handleEndRdsGroup()
+{
+
+}
+
+/*!
+ *
+ */
+void T_RadioDataParser::handleStartRdsData( const QXmlAttributes& atts )
+{
+    RadioData::RdsItem* rds = new RadioData::RdsItem;
+    pushToSettingStack( rds, mSettingStack );
+}
+
+/*!
+ *
+ */
+void T_RadioDataParser::handleEndRdsData()
+{
+    QScopedPointer<RadioData::RdsItem> rds(
+            static_cast<RadioData::RdsItem*>( popFromSettingStack( mSettingStack ) ) );
+    RadioData::Station* station = dynamic_cast<RadioData::Station*>( topOfSettingStack( mSettingStack ) );
+    if ( rds && station )
+    {
+        station->mRdsArray.append( rds.take() );
+    }
+}
+
+/*!
+ *
+ */
+void T_RadioDataParser::pushToSettingStack( RadioData::Setting* setting, RadioData::SettingArray& array )
+{
+    array.append( setting );
+}
+
+/*!
+ *
+ */
+RadioData::Setting* T_RadioDataParser::topOfSettingStack( RadioData::SettingArray& array )
+{
+    if ( array.count() > 0 )
+        {
+        return array[ array.count() - 1 ];
+        }
+
+    return 0;
+}
+
+/*!
+ *
+ */
+RadioData::Setting* T_RadioDataParser::popFromSettingStack( RadioData::SettingArray& array )
+{
+    const int lastIndex = array.count() - 1;
+    RadioData::Setting* setting = array[lastIndex];
+    array.removeAt( lastIndex );
+    return setting;
+}
+
+/*!
+ *
+ */
+int T_RadioDataParser::parseInt( const QString& string, int defaultVal )
+{
+    bool ok = false;
+    int ret = string.toInt( &ok );
+    if ( ok ) {
+        return ret;
+    }
+    return defaultVal;
+}
+
+/*!
+ *
+ */
+int T_RadioDataParser::parseTime( const QString& string, int defaultVal )
+{
+    if ( isEqual( string.right( 2 ), KXmlMilliseconds ) ) {
+        QString temp = string.mid( 0, string.length() - 2 );
+        return parseInt( temp, defaultVal );
+    } else if ( isEqual( string.right( 1 ), KXmlSeconds ) ) {
+        QString temp = string.mid( 0, string.length() - 1 );
+        return parseInt( temp, defaultVal ) * KThousand;
+    } else if ( isEqual( string.right( 1 ), KXmlMinutes ) ) {
+        QString temp = string.mid( 0, string.length() - 1 );
+        return parseInt( temp, defaultVal ) * KMillion;
+    } else {
+        // Default time is seconds
+        return parseInt( string, defaultVal ) * KThousand;
+    }
+}
+
+
+RadioData::RdsGroup::RdsGroup( const QXmlAttributes& atts, T_RadioDataParser& parser ) :
+    mInterval( 0 ),
+    mCount( 0 )
+{
+    for ( int i = 0; i < atts.count(); ++i ) {
+        QString attrName = atts.localName( i );
+
+        if ( isEqual( attrName, KXmlInterval ) )
+        {
+            mInterval = parser.parseTime( atts.value( i ), 0 );
+        }
+        else if ( isEqual( attrName, KXmlCount ) == 0 )
+        {
+            mCount = parser.parseInt( atts.value( i ), 0 );
+        }
+    }
+
+}
+
+RadioData::RdsGroup::~RdsGroup()
+{
+
+}
+
+RadioData::Station::Station() :
+    mFrequency( 0 )
+{
+}
+
+RadioData::Station::~Station()
+{
+    qDeleteAll( mRdsArray );
+    mRdsArray.clear();
+}
+
+void RadioData::Station::setValue( SettingHolder& holder, T_RadioDataParser& parser )
+{
+    if ( isEqual( holder.mName, KXmlFrequency ) )
+    {
+        int valueInt = 0;
+        parser.parseInt( holder.mValue, valueInt );
+        mFrequency = static_cast<uint>( valueInt );
+    }
+}
+
+
+RadioData::RdsItem::RdsItem() :
+    mCurrentRtPlusIndex( 0 ),
+    mType( RadioData::RdsItem::Unknown )
+{
+}
+
+RadioData::RdsItem::RtPlusHolder::RtPlusHolder() :
+    mDelay( 0 ),
+    mRtClass( 0 )
+{
+}
+
+RadioData::RdsItem::~RdsItem()
+{
+    qDeleteAll( mRtPlusItems );
+    mRtPlusItems.clear();
+}
+
+void RadioData::RdsItem::setValue( SettingHolder& holder, T_RadioDataParser& parser )
+{
+    if ( holder.mChildren.count() == 0 )
+    {
+        if ( isEqual( holder.mName, KXmlInterval ) )
+        {
+            mInterval = parser.parseInt( holder.mValue, 0 );
+        }
+        else if ( isEqual( holder.mName, KXmlType ) )
+        {
+            if ( isEqual( holder.mValue, KXmlRdsPsName ) )
+            {
+                mType = RadioData::RdsItem::RdsPsName;
+            }
+            else if ( isEqual( holder.mValue, KXmlRdsRt ) )
+            {
+                mType = RadioData::RdsItem::RdsRadioText;
+            }
+            else if ( isEqual( holder.mValue, KXmlRdsRt ) )
+            {
+                mType = RadioData::RdsItem::RdsRadioText;
+            }
+            else if ( isEqual( holder.mValue, KXmlRdsRtPlus ) )
+            {
+                mType = RadioData::RdsItem::RdsRadioTextPlus;
+            }
+            else if ( isEqual( holder.mValue, KXmlRdsPty ) )
+            {
+                mType = RadioData::RdsItem::RdsPty;
+            }
+            if ( isEqual( holder.mValue, KXmlRdsPiCode ) )
+            {
+                mType = RadioData::RdsItem::RdsPiCode;
+            }
+        }
+        else if ( isEqual( holder.mName, KXmlRdsItem ) )
+        {
+            mRdsItems.append( holder.mValue );
+        }
+    }
+    else
+    {
+        initChildren( holder, parser );
+    }
+}
+
+void RadioData::RdsItem::initChildren( SettingHolder& holder, T_RadioDataParser& parser )
+{
+    mRdsItems.append( holder.mValue );
+
+    for ( int i = 0; i < holder.mChildren.count(); ++i )
+    {
+        RtPlusHolder* rtPlusHolder = new RtPlusHolder;
+        mRtPlusItems.append( rtPlusHolder );
+
+        SettingHolder* child = holder.mChildren[i];
+        if ( isEqual( child->mName, KXmlRdsRtPlusTag ) )
+        {
+            rtPlusHolder->mRtClass = RadioData::RdsItem::Title;
+            if ( isEqual( child->mValue, KXmlRdsRtPlusTagArtist ) )
+            {
+                rtPlusHolder->mRtClass = RadioData::RdsItem::Artist;
+            }
+        }
+
+        for ( int j = 0; j < child->mChildren.count(); ++j )
+        {
+            SettingHolder* grandChild = child->mChildren[j];
+            if ( isEqual( grandChild->mName, KXmlRdsRtPlusTagDelay ) )
+            {
+                parser.parseInt( grandChild->mValue, rtPlusHolder->mDelay );
+            }
+            else if ( isEqual( grandChild->mName, KXmlRdsItem ) )
+            {
+                rtPlusHolder->mRtItem = grandChild->mValue;
+            }
+        }
+    }
+}
+
+RadioData::SettingHolder::SettingHolder()
+{
+}
+
+RadioData::SettingHolder::~SettingHolder()
+{
+    qDeleteAll( mChildren );
+    mChildren.clear();
+}
+
+RadioData::EngineSettings::EngineSettings() :
+    mMaxVolume( 0 ),
+    mFrequencyStepSize( 0 ),
+    mRegionId( 0 ),
+    mMinFrequency( 0 ),
+    mMaxFrequency( 0 )
+{
+}
+
+void RadioData::EngineSettings::setValue( SettingHolder& holder, T_RadioDataParser& parser )
+{
+    if ( isEqual( holder.mName, KXmlMaxVolume ) )
+    {
+        parser.parseInt( holder.mValue, mMaxVolume );
+    }
+    else if ( isEqual( holder.mName, KXmlFrequencyStepSize ) )
+    {
+        parser.parseInt( holder.mValue, mFrequencyStepSize );
+    }
+    else if ( isEqual( holder.mName, KXmlRegion ) )
+    {
+        parser.parseInt( holder.mValue, mRegionId );
+    }
+    else if ( isEqual( holder.mName, KXmlMinFrequency ) )
+    {
+        int valueInt = 0;
+        parser.parseInt( holder.mValue, valueInt );
+        mMinFrequency = static_cast<uint>( valueInt );
+    }
+    else if ( isEqual( holder.mName, KXmlMaxFrequency ) )
+    {
+        int valueInt = 0;
+        parser.parseInt( holder.mValue, valueInt );
+        mMaxFrequency = static_cast<uint>( valueInt );
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiopresetstorage/inc/radiopresetstorage.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef RADIOPRESETSTORAGE_H_
+#define RADIOPRESETSTORAGE_H_
+
+// System includes
+#include <QtGlobal>
+
+#include "radiopresetstorageexport.h"
+
+// Forward declarations
+class RadioStationIf;
+class RadioPresetStoragePrivate;
+
+class STORAGE_DLL_EXPORT RadioPresetStorage
+{
+    Q_DECLARE_PRIVATE_D( d_ptr, RadioPresetStorage )
+    Q_DISABLE_COPY( RadioPresetStorage )
+
+public:
+
+    RadioPresetStorage();
+    ~RadioPresetStorage();
+
+    int maxNumberOfPresets() const;
+    int presetCount() const;
+    int firstPreset() const;
+    int nextPreset( int fromIndex ) const;
+    bool deletePreset( int presetIndex );
+    bool savePreset( const RadioStationIf& station );
+    bool readPreset( int index, RadioStationIf& station );
+
+private: // data
+
+    /**
+     * Unmodifiable pointer to the private implementation
+     */
+    RadioPresetStoragePrivate* const d_ptr;
+
+};
+
+#endif // RADIOPRESETSTORAGE_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiopresetstorage/inc/radiopresetstorage_p.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef RADIOPRESETSTORAGE_P_H_
+#define RADIOPRESETSTORAGE_P_H_
+
+// System includes
+#ifndef COMPILE_WITH_NEW_PRESET_UTILITY
+#   include <RadioPresetUtility.h>
+#endif // COMPILE_WITH_NEW_PRESET_UTILITY
+
+#include <QScopedPointer>
+#include <e32std.h>
+
+// User includes
+
+// Forward declarations
+#ifdef COMPILE_WITH_NEW_PRESET_UTILITY
+    class CPresetUtility;
+    typedef QScopedPointer<CPresetUtility> PresetUtilityPtr;
+#else
+    class CRadioFmPresetUtility;
+    typedef QScopedPointer<CRadioFmPresetUtility> PresetUtilityPtr;
+#endif // COMPILE_WITH_NEW_PRESET_UTILITY
+
+class RadioPresetStoragePrivate
+#ifndef COMPILE_WITH_NEW_PRESET_UTILITY
+                                : public MRadioPresetObserver
+#endif // COMPILE_WITH_NEW_PRESET_UTILITY
+{
+public:
+
+    RadioPresetStoragePrivate();
+    ~RadioPresetStoragePrivate();
+
+    bool init();
+
+#ifndef COMPILE_WITH_NEW_PRESET_UTILITY
+private:
+    void MrpeoPresetChanged( TPresetChangeEvent /*aChange*/, TInt /*aIndex*/ ) {}
+#endif // COMPILE_WITH_NEW_PRESET_UTILITY
+
+public: // data
+
+    PresetUtilityPtr   mPresetUtility;
+
+};
+
+#endif // RADIOPRESETSTORAGE_P_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiopresetstorage/inc/radiopresetstorage_win32_p.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,70 @@
+/*
+* 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 RADIOPRESETSTORAGE_P_H_
+#define RADIOPRESETSTORAGE_P_H_
+
+// User includes
+#include <QScopedPointer>
+#include <QByteArray>
+
+// Forward declarations
+class QSettings;
+class QDataStream;
+
+class Preset
+{
+public:
+
+    Preset();
+    ~Preset();
+
+    void externalize( QDataStream& outStream );
+    void internalize( QDataStream& inStream );
+
+    uint        mFrequency;
+    QString     mName;
+    bool        mRenamedByUser;
+    int         mGenre;
+    QString     mUrl;
+    int         mPiCode;
+    bool        mFavorite;
+    bool        mLocalStation;
+
+};
+
+class RadioPresetStoragePrivate
+{
+public:
+
+    RadioPresetStoragePrivate();
+    ~RadioPresetStoragePrivate();
+
+    bool init();
+
+    void readBookKeeping();
+    void saveBookKeeping();
+
+    void removeIndex( int index );
+    void addIndex( int index );
+
+    QScopedPointer<QSettings>   mSettings;
+    QByteArray                  mBookKeeping;
+
+};
+
+#endif // RADIOPRESETSTORAGE_P_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiopresetstorage/inc/radiopresetstorageexport.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef RADIO_PRESET_STORAGE_EXPORT_H_
+#define RADIO_PRESET_STORAGE_EXPORT_H_
+
+// System includes
+#include <QtGlobal>
+
+#ifdef BUILD_PRESET_STORAGE_DLL
+    #define STORAGE_DLL_EXPORT Q_DECL_EXPORT
+#else
+    #define STORAGE_DLL_EXPORT Q_DECL_IMPORT
+#endif
+
+#endif // RADIO_PRESET_STORAGE_EXPORT_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiopresetstorage/inc/radiostationif.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,58 @@
+/*
+* 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 RADIOSTATIONIF_H_
+#define RADIOSTATIONIF_H_
+
+// System includes
+#include <QtGlobal>
+
+class RadioStationIf
+{
+public:
+
+    virtual int presetIndex() const = 0;
+    virtual void setPresetIndex( int presetIndex ) = 0;
+
+    virtual uint frequency() const = 0;
+    virtual void setFrequency( uint frequency ) = 0;
+
+    virtual QString name() const = 0;
+    virtual void setName( QString name ) = 0;
+
+    virtual bool isRenamedByUser() const = 0;
+    virtual void setRenamedByUser( bool renamed ) = 0;
+
+    virtual int genre() const = 0;
+    virtual void setGenre( int genre ) = 0;
+
+    virtual QString url() const = 0;
+    virtual void setUrl( QString url ) = 0;
+
+    virtual int piCode() const = 0;
+    virtual void setPiCode( int piCode ) = 0;
+
+    virtual bool isFavorite() const = 0;
+    virtual void setFavorite( bool favorite ) = 0;
+
+    virtual bool isLocalStation() const = 0;
+    virtual void setLocalStation( bool localStation ) = 0;
+
+};
+
+
+#endif // RADIOSTATIONIF_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiopresetstorage/radiopresetstorage.pro	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,50 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+include(../buildflags.pri)
+
+TEMPLATE    = lib
+TARGET      = radiopresetstorage
+CONFIG      += dll
+DEFINES     += BUILD_PRESET_STORAGE_DLL
+
+INCLUDEPATH += inc
+
+COMPILE_WITH_NEW_PRESET_UTILITY {
+    INCLUDEPATH += /epoc32/include/newfmpresetutility
+    symbian:LIBS += -lpresetutility
+} else {
+    symbian:LIBS += -lfmpresetutility
+}
+
+DEPENDPATH += $$INCLUDEPATH src
+
+# Input
+HEADERS     += radiopresetstorage.h
+HEADERS     += radiostationif.h
+HEADERS     += radiopresetstorageexport.h
+
+# Symbian specific stuff
+symbian: {
+    INTERNAL_HEADERS += radiopresetstorage_p.h
+    SOURCES += radiopresetstorage.cpp
+}
+
+# Win32 specific stuff
+win32: {
+    HEADERS += radiopresetstorage_win32_p.h
+    SOURCES += radiopresetstorage_win32.cpp
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiopresetstorage/src/radiopresetstorage.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,232 @@
+/*
+* 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:
+*
+*/
+
+// System includes
+#ifdef COMPILE_WITH_NEW_PRESET_UTILITY
+#include <presetutility.h>
+#include <preset.h>
+#else
+#   include <RadioFmPresetUtility.h>
+#endif // COMPILE_WITH_NEW_PRESET_UTILITY
+
+#include <QString>
+
+// User includes
+#include "radiopresetstorage.h"
+#include "radiopresetstorage_p.h"
+#include "radiostationif.h"
+
+/*!
+ * Converts a symbian descriptor to Qt string
+ */
+static QString convertString( const TDesC& aDesc )
+{
+    return QString( (QChar*)aDesc.Ptr(), aDesc.Length() );
+}
+
+/*!
+ *
+ */
+RadioPresetStorage::RadioPresetStorage() :
+    d_ptr( new RadioPresetStoragePrivate() )
+{
+    Q_D( RadioPresetStorage );
+    d->init();
+}
+
+/*!
+ *
+ */
+RadioPresetStorage::~RadioPresetStorage()
+{
+    delete d_ptr;
+}
+
+/*!
+ *
+ */
+int RadioPresetStorage::maxNumberOfPresets() const
+{
+    Q_D( const RadioPresetStorage );
+#ifdef COMPILE_WITH_NEW_PRESET_UTILITY
+    return d->mPresetUtility->MaxNumberOfPresets();
+#else
+    TInt maxPresets = 0;
+    d->mPresetUtility->GetMaxNumberOfPresets( maxPresets );
+    return maxPresets;
+#endif // COMPILE_WITH_NEW_PRESET_UTILITY
+}
+
+/*!
+ *
+ */
+int RadioPresetStorage::presetCount() const
+{
+    Q_D( const RadioPresetStorage );
+#ifdef COMPILE_WITH_NEW_PRESET_UTILITY
+    return d->mPresetUtility->PresetCount();
+#else
+    TInt presetCount = 0;
+    d->mPresetUtility->GetNumberOfPresets( presetCount );
+    return presetCount;
+#endif // COMPILE_WITH_NEW_PRESET_UTILITY
+}
+
+/*!
+ *
+ */
+int RadioPresetStorage::firstPreset() const
+{
+    Q_D( const RadioPresetStorage );
+#ifdef COMPILE_WITH_NEW_PRESET_UTILITY
+    return d->mPresetUtility->FirstPreset();
+#else
+    TInt firstIndex = -1;
+    TRAPD( err, d->mPresetUtility->GetFirstPresetL( firstIndex ) );
+    if ( err ) {
+        firstIndex = -1;
+    }
+    return firstIndex;
+#endif // COMPILE_WITH_NEW_PRESET_UTILITY
+}
+
+/*!
+ *
+ */
+int RadioPresetStorage::nextPreset( int fromIndex ) const
+{
+    Q_D( const RadioPresetStorage );
+#ifdef COMPILE_WITH_NEW_PRESET_UTILITY
+    return d->mPresetUtility->NextPreset( fromIndex );
+#else
+    TInt nextIndex = -1;
+    TRAPD( err, d->mPresetUtility->GetNextPresetL( fromIndex, nextIndex ) );
+    if ( err ) {
+        nextIndex = -1;
+    }
+    return nextIndex;
+#endif // COMPILE_WITH_NEW_PRESET_UTILITY
+}
+
+/*!
+ *
+ */
+bool RadioPresetStorage::deletePreset( int presetIndex )
+{
+    Q_D( RadioPresetStorage );
+#ifdef COMPILE_WITH_NEW_PRESET_UTILITY
+    return d->mPresetUtility->DeletePreset( presetIndex ) == KErrNone;
+#else
+    TRAPD( err, d->mPresetUtility->DeletePresetL( presetIndex ) );
+    return err;
+#endif // COMPILE_WITH_NEW_PRESET_UTILITY
+}
+
+/*!
+ *
+ */
+bool RadioPresetStorage::savePreset( const RadioStationIf& station )
+{
+    Q_D( RadioPresetStorage );
+#ifdef COMPILE_WITH_NEW_PRESET_UTILITY
+    TPreset preset;
+    preset.SetFrequency( station.frequency() );
+    TPresetName name( station.name().utf16() );
+    preset.SetName( name );
+    preset.SetRenamedByUser( station.isRenamedByUser() );
+    preset.SetGenre( station.genre() );
+    TRadioUrl url( station.url().utf16() );
+    preset.SetUrl( url );
+    preset.SetPiCode( station.piCode() );
+    preset.SetFavorite( station.isFavorite() );
+    preset.SetLocalStation( station.isLocalStation() );
+
+    TRAPD( err, d->mPresetUtility->SavePresetL( preset, station.presetIndex() ) );
+    return err == KErrNone;
+#else
+    TFmPresetName name( station.name().utf16() );
+    TRAPD( err, d->mPresetUtility->SetPresetL( station.presetIndex(), name, station.frequency() ) );
+    return err == KErrNone;
+#endif // COMPILE_WITH_NEW_PRESET_UTILITY
+}
+
+/*!
+ *
+ */
+bool RadioPresetStorage::readPreset( int index, RadioStationIf& station )
+{
+    Q_D( RadioPresetStorage );
+#ifdef COMPILE_WITH_NEW_PRESET_UTILITY
+    TPreset preset;
+    TRAPD( err, d->mPresetUtility->ReadPresetL( index, preset ) );
+    if ( !err ) {
+
+        station.setPresetIndex( index );
+        station.setFrequency( preset.Frequency() );
+        station.setName( convertString( preset.Name() ) );
+        station.setRenamedByUser( preset.RenamedByUser() );
+        station.setGenre( preset.Genre() );
+        station.setUrl( convertString( preset.Url() ) );
+        station.setPiCode( preset.PiCode() );
+        station.setFavorite( preset.Favorite() );
+        station.setLocalStation( preset.LocalStation() );
+
+        return true;
+    }
+    return false;
+#else
+    TFmPresetName nameDesc;
+    TInt frequency = 0;
+    TRAPD( err, d->mPresetUtility->GetPresetL( index, nameDesc, frequency ) );
+    if ( !err )
+    {
+        station.setPresetIndex( index );
+        station.setName( convertString( nameDesc ) );
+        station.setFrequency( static_cast<TUint>( frequency ) );
+        station.setLocalStation( true );
+    }
+    return err == KErrNone;
+#endif // COMPILE_WITH_NEW_PRESET_UTILITY
+}
+
+/*!
+ *
+ */
+RadioPresetStoragePrivate::RadioPresetStoragePrivate()
+{
+}
+
+/*!
+ *
+ */
+RadioPresetStoragePrivate::~RadioPresetStoragePrivate()
+{
+}
+
+/*!
+ *
+ */
+bool RadioPresetStoragePrivate::init()
+{
+#ifdef COMPILE_WITH_NEW_PRESET_UTILITY
+    TRAPD( err, mPresetUtility.reset( CPresetUtility::NewL() ) );
+    
+#else
+    TRAPD( err, mPresetUtility.reset( CRadioFmPresetUtility::NewL( *this ) ) );
+#endif // COMPILE_WITH_NEW_PRESET_UTILITY
+    return err == KErrNone;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiopresetstorage/src/radiopresetstorage_win32.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,293 @@
+/*
+* 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:
+*
+*/
+
+// System includes
+#include <QString>
+#include <QSettings>
+#include <QDataStream>
+
+// User includes
+#include "radiopresetstorage.h"
+#include "radiopresetstorage_win32_p.h"
+#include "radiostationif.h"
+
+const QString KKeyBookKeeping = "BookKeeping";
+const QString KKeyBase = "Preset-";
+
+/*!
+ *
+ */
+static QString makeKey( int index ) {
+    QString key = KKeyBase;
+    key.append( index );
+    return key;
+}
+
+/*!
+ *
+ */
+Preset::Preset() :
+    mFrequency( 0 ),
+    mRenamedByUser( false ),
+    mGenre( -1 ),
+    mPiCode( -1 ),
+    mFavorite( false ),
+    mLocalStation( false )
+{
+}
+
+/*!
+ *
+ */
+Preset::~Preset()
+{
+}
+
+/*!
+ *
+ */
+void Preset::externalize( QDataStream& outStream )
+{
+    outStream << mFrequency;
+    outStream << mName;
+    outStream << mRenamedByUser;
+    outStream << mGenre;
+    outStream << mUrl;
+    outStream << mPiCode;
+    outStream << mFavorite;
+    outStream << mLocalStation;
+}
+
+/*!
+ *
+ */
+void Preset::internalize( QDataStream& inStream )
+{
+    inStream >> mFrequency;
+    inStream >> mName;
+    inStream >> mRenamedByUser;
+    inStream >> mGenre;
+    inStream >> mUrl;
+    inStream >> mPiCode;
+    inStream >> mFavorite;
+    inStream >> mLocalStation;
+}
+
+/*!
+ *
+ */
+RadioPresetStorage::RadioPresetStorage() :
+    d_ptr( new RadioPresetStoragePrivate() )
+{
+    Q_D( RadioPresetStorage );
+    d->init();
+}
+
+/*!
+ *
+ */
+RadioPresetStorage::~RadioPresetStorage()
+{
+}
+
+/*!
+ *
+ */
+int RadioPresetStorage::maxNumberOfPresets() const
+{
+    return 100;
+}
+
+/*!
+ *
+ */
+int RadioPresetStorage::presetCount() const
+{
+    Q_D( const RadioPresetStorage );
+    return d->mBookKeeping.count();
+}
+
+/*!
+ *
+ */
+int RadioPresetStorage::firstPreset() const
+{
+    Q_D( const RadioPresetStorage );
+    if ( d->mBookKeeping.count() > 0 ) {
+        return d->mBookKeeping.at( 0 );
+    }
+    return -1;
+}
+
+/*!
+ *
+ */
+int RadioPresetStorage::nextPreset( int fromIndex ) const
+{
+    Q_D( const RadioPresetStorage );
+    int index = d->mBookKeeping.indexOf( fromIndex ) + 1;
+    if ( index > 0 && index < d->mBookKeeping.count() ) {
+        return d->mBookKeeping.at( index );
+    }
+    return -1;
+}
+
+/*!
+ *
+ */
+bool RadioPresetStorage::deletePreset( int presetIndex )
+{
+    Q_D( RadioPresetStorage );
+    if ( presetIndex > -1 ) {
+        int index = d->mBookKeeping.indexOf( presetIndex );
+        if ( index > -1 ) {
+            d->mBookKeeping.remove( index, 1 );
+            d->mSettings->remove( makeKey( presetIndex ) );
+            d->removeIndex( presetIndex );
+            return true;
+        }
+    } else if ( presetIndex == -1 ) {
+        for ( int i = d->mBookKeeping.count() - 1; i >= 0; --i ) {
+            d->mSettings->remove( makeKey( d->mBookKeeping.at( i ) ) );
+        }
+        d->mBookKeeping.clear();
+        return true;
+    }
+    return false;
+}
+
+/*!
+ *
+ */
+bool RadioPresetStorage::savePreset( const RadioStationIf& station )
+{
+    Preset preset;
+    preset.mFrequency = station.frequency();
+    preset.mName = station.name();
+    preset.mRenamedByUser = station.isRenamedByUser()   ;
+    preset.mGenre = station.genre();
+    preset.mUrl = station.url();
+    preset.mPiCode = station.piCode();
+    preset.mFavorite = station.isFavorite();
+    preset.mLocalStation = station.isLocalStation();
+
+    QByteArray array;
+    QDataStream outStream( &array, QIODevice::WriteOnly );
+    preset.externalize( outStream );
+
+    Q_D( RadioPresetStorage );
+    d->mSettings->setValue( makeKey( station.presetIndex() ), array );
+
+    d->addIndex( station.presetIndex() );
+
+    return true;
+}
+
+/*!
+ *
+ */
+bool RadioPresetStorage::readPreset( int index, RadioStationIf& station )
+{
+    Q_D( RadioPresetStorage );
+    QByteArray array = d->mSettings->value( makeKey( index ) ).toByteArray();
+    if ( !array.isEmpty() ) {
+        Preset preset;
+
+        QDataStream inStream( array );
+        preset.internalize( inStream );
+
+        station.setPresetIndex( index );
+        station.setFrequency( preset.mFrequency );
+        station.setName( preset.mName );
+        station.setRenamedByUser( preset.mRenamedByUser );
+        station.setGenre( preset.mGenre );
+        station.setUrl( preset.mUrl );
+        station.setPiCode( preset.mPiCode );
+        station.setFavorite( preset.mFavorite );
+        station.setLocalStation( preset.mLocalStation );
+
+        return true;
+    }
+    return false;
+}
+
+/*!
+ *
+ */
+RadioPresetStoragePrivate::RadioPresetStoragePrivate()
+{
+}
+
+/*!
+ *
+ */
+RadioPresetStoragePrivate::~RadioPresetStoragePrivate()
+{
+}
+
+/*!
+ *
+ */
+bool RadioPresetStoragePrivate::init()
+{
+    mSettings.reset( new QSettings( "Nokia", "QtFmRadio" ) );
+    readBookKeeping();
+    return true;
+}
+
+/*!
+ *
+ */
+void RadioPresetStoragePrivate::readBookKeeping()
+{
+    QVariant value = mSettings->value( KKeyBookKeeping );
+    if ( value.isValid() ) {
+        mBookKeeping = value.toByteArray();
+    }
+}
+
+/*!
+ *
+ */
+void RadioPresetStoragePrivate::saveBookKeeping()
+{
+    mSettings->setValue( KKeyBookKeeping, mBookKeeping );
+}
+
+/*!
+ *
+ */
+void RadioPresetStoragePrivate::removeIndex( int index )
+{
+    int pos = mBookKeeping.indexOf( index );
+    if ( pos > -1 ) {
+        mBookKeeping.remove( pos, 1 );
+        saveBookKeeping();
+    }
+}
+
+/*!
+ *
+ */
+void RadioPresetStoragePrivate::addIndex( int index )
+{
+    int pos = mBookKeeping.indexOf( index );
+    if ( pos == -1 ) {
+        mBookKeeping.append( index );
+        saveBookKeeping();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiopresetstorage/tsrc/inc/t_radiopresetstorage.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#ifndef T_RADIOPRESETSTORAGE_H_
+#define T_RADIOPRESETSTORAGE_H_
+
+
+// INCLUDES
+#include <QtTest/QtTest>
+#include "radiopresetstorage.h"
+
+
+class RadioPresetStorage;
+
+class TestRadioPresetStorage : public QObject
+{
+    Q_OBJECT    
+    
+public:
+
+    TestRadioPresetStorage();
+    ~TestRadioPresetStorage();    
+
+public slots:
+    
+private slots:
+    // test framework called slots 
+    void initTestCase();
+    void init();
+    void cleanup();
+    void cleanupTestCase();
+    void testSavePreset();
+    void testReadPreset();
+    void testDeletePreset();
+    void testStessTest();
+    
+private:
+    
+private:
+	QScopedPointer<RadioPresetStorage>  mPresetStorage;
+};
+
+#endif /* T_RADIOPRESETSTORAGE_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiopresetstorage/tsrc/src/t_radiopresetstorage.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,225 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#include "t_radiopresetstorage.h"
+#include "radiopresetstorage.h"
+#include "radiostation.h"
+#include "radiostation_p.h"
+
+// Constants
+const uint KTestFrequency1 = 89000000;
+const uint KTestFrequency2 = 89500000;
+const uint KTestFrequency3 = 90000000;
+const uint KTestFrequency4 = 90500000;
+const uint KMaxNumberOfPresets = 100;
+const uint KInvalidPresetIndex = -2;
+const uint KFirstPresetIndex = 0;
+const uint KSecondPresetIndex = 1;
+const uint KThirdPresetIndex = 2;
+const uint KFrequencyStep = 100000;
+
+/*!
+ *
+ */
+int main(int /* argc*/, char *argv[])
+{
+    TestRadioPresetStorage tv;
+
+    char *pass[3];
+    pass[0] = argv[0];
+    pass[1] = "-o";
+    pass[2] = "c:\\data\\testradiopresetstorage.txt";
+
+    int res = QTest::qExec(&tv, 3, pass);
+
+    return res;
+}
+
+
+TestRadioPresetStorage::TestRadioPresetStorage()
+{
+}
+
+
+/*!
+ * Destructor
+ */
+TestRadioPresetStorage::~TestRadioPresetStorage()
+{
+}
+
+/*!
+ * called before each testfunction is executed
+ */
+void TestRadioPresetStorage::init()
+{
+}
+
+/*!
+ * called after every testfunction
+ */
+void TestRadioPresetStorage::cleanup()
+{
+}
+
+/*!
+ * called before the first testfunction is executed
+ */
+void TestRadioPresetStorage::initTestCase()
+{
+    mPresetStorage.reset( new RadioPresetStorage() );
+    // this is the range used in this test module
+    for(int i = 0; i <= mPresetStorage->maxNumberOfPresets(); i++)
+    {
+        mPresetStorage->deletePreset( i );        
+    }    
+    QVERIFY2(( mPresetStorage->presetCount() == 0 ), "API:RadioPresetStorage initTestCase 1");    
+    // TODO: replace the local constant with the constand defined in preset utility header  
+    QVERIFY2(( mPresetStorage->maxNumberOfPresets() == KMaxNumberOfPresets ), "API:RadioPresetStorage initTestCase 2");
+}
+
+/*!
+ * called after the last testfunction was executed
+ */
+void TestRadioPresetStorage::cleanupTestCase()
+{
+	
+}
+
+/*!
+ * Test saving preset 
+ */
+void TestRadioPresetStorage::testSavePreset()
+{
+  int test = mPresetStorage->maxNumberOfPresets();
+  int initialPresetCount( 0 );
+  //int initialPresetindex( KFirstPresetIndex );  
+  RadioStation station;  
+  station.setFrequency( KTestFrequency1 );
+  station.setPresetIndex( KFirstPresetIndex );
+  mPresetStorage->savePreset( *station.data_ptr() );
+  QVERIFY2(( mPresetStorage->presetCount() == initialPresetCount + 1 ), "API:RadioPresetStorage testSavePreset 1");
+  QVERIFY2(( mPresetStorage->nextPreset( KFirstPresetIndex ) == 0 ), "API:RadioPresetStorage testSavePreset 2");
+  
+  station.setFrequency( KTestFrequency2 );
+  station.setPresetIndex( KSecondPresetIndex );
+  mPresetStorage->savePreset( *station.data_ptr() );
+  QVERIFY2(( mPresetStorage->presetCount() == initialPresetCount + 2 ), "API:RadioPresetStorage testSavePreset 3");
+  QVERIFY2(( mPresetStorage->nextPreset( KFirstPresetIndex ) == KSecondPresetIndex ), "API:RadioPresetStorage testSavePreset 4");
+  
+  // check that saving preset fails if preset index and frequency are allready in use
+  station.setFrequency( KTestFrequency2 );
+  station.setPresetIndex( KSecondPresetIndex );
+  mPresetStorage->savePreset( *station.data_ptr() );
+  QVERIFY2(( mPresetStorage->presetCount() == initialPresetCount + 2 ), "API:RadioPresetStorage testSavePreset 5");
+  
+  // check that saving preset success when new preset index and frequency are not in use
+  station.setFrequency( KTestFrequency3 );
+  station.setPresetIndex( KThirdPresetIndex );  
+  mPresetStorage->savePreset( *station.data_ptr() );
+  QVERIFY2(( mPresetStorage->presetCount() == initialPresetCount + 3 ), "API:RadioPresetStorage testSavePreset 6");
+  
+  // check that saving with invalid preset index fails
+  station.setFrequency( KTestFrequency4 );
+  station.setPresetIndex( KInvalidPresetIndex );  
+  mPresetStorage->savePreset( *station.data_ptr() );
+  QVERIFY2(( mPresetStorage->presetCount() == initialPresetCount + 3 ), "API:RadioPresetStorage testSavePreset 6");
+}
+
+/*!
+ * Test reading preset 
+ */
+void TestRadioPresetStorage::testReadPreset()
+{
+  RadioStation station;
+  RadioStationIf* preset = static_cast<RadioStationIf*>( station.data_ptr() );
+  mPresetStorage->readPreset( KFirstPresetIndex, *preset );  
+  QVERIFY2(( preset->frequency() == KTestFrequency1 ), "API:RadioPresetStorage testReadPreset 1");
+  
+  RadioStation station1;
+  RadioStationIf* preset1 = static_cast<RadioStationIf*>( station1.data_ptr() );
+  mPresetStorage->readPreset( KSecondPresetIndex, *preset1 );
+  QVERIFY2(( preset->frequency() == KTestFrequency2 ), "API:RadioPresetStorage testReadPreset 2");  
+  
+  RadioStation station2;
+  RadioStationIf* preset2 = static_cast<RadioStationIf*>( station2.data_ptr() );
+  mPresetStorage->readPreset( KThirdPresetIndex, *preset2 );
+  QVERIFY2(( preset->frequency() == KTestFrequency3 ), "API:RadioPresetStorage testReadPreset 3");
+  
+  RadioStation station3;
+  RadioStationIf* preset3 = static_cast<RadioStationIf*>( station3.data_ptr() );
+  // test the value returned with invalid preset index
+  mPresetStorage->readPreset( KThirdPresetIndex + 1, *preset3 );
+  // TODO: change the value to KErrNotFound when preset utility update done
+  QVERIFY2(( preset->frequency() == 87500000 ), "API:RadioPresetStorage testReadPreset 4");
+}
+
+/*!
+ * Test deleting preset
+ */
+void TestRadioPresetStorage::testDeletePreset()
+{   
+    int initialPresetCount( mPresetStorage->presetCount() );
+    
+    QVERIFY2(( mPresetStorage->firstPreset() == KFirstPresetIndex ), "API:RadioPresetStorage testDeletePreset 1");
+    QVERIFY2(( mPresetStorage->nextPreset( KFirstPresetIndex ) == KSecondPresetIndex ), "API:RadioPresetStorage testDeletePreset 2");
+    mPresetStorage->deletePreset( KSecondPresetIndex );
+    QVERIFY2(( mPresetStorage->nextPreset( KFirstPresetIndex ) == KThirdPresetIndex ), "API:RadioPresetStorage testDeletePreset 3");
+    QVERIFY2(( mPresetStorage->presetCount() == (initialPresetCount - 1)), "API:RadioPresetStorage testDeletePreset 4");       
+    
+    RadioStation station;
+    RadioStationIf* preset = static_cast<RadioStationIf*>( station.data_ptr() );
+    mPresetStorage->readPreset( KSecondPresetIndex, *preset );
+    // TODO: change the value to KErrNotFound when preset utility update done
+    QVERIFY2(( preset->frequency() == 87500000 ), "API:RadioPresetStorage testDeletePreset 5");
+    
+    mPresetStorage->deletePreset( KFirstPresetIndex );
+    QVERIFY2(( mPresetStorage->firstPreset() == KThirdPresetIndex ), "API:RadioPresetStorage testDeletePreset 6");
+    mPresetStorage->deletePreset( KThirdPresetIndex );
+    QVERIFY2(( mPresetStorage->presetCount() == 0), "API:RadioPresetStorage testDeletePreset 7");
+}
+  
+/*!
+ * Test filling preset storage and handling boundary values
+ */
+void TestRadioPresetStorage::testStessTest()
+{
+    for(int i = 0; i < mPresetStorage->maxNumberOfPresets(); i++)
+    {
+        RadioStation station;
+        station.setFrequency( 87500000 + i*KFrequencyStep );
+        station.setPresetIndex( i );  
+        mPresetStorage->savePreset( *station.data_ptr() );
+    }
+    QVERIFY2(( mPresetStorage->presetCount() == mPresetStorage->maxNumberOfPresets()), "API:RadioPresetStorage testStessTest 1");
+    int test = mPresetStorage->presetCount();
+    RadioStation station;
+    station.setFrequency( 87500000 + mPresetStorage->maxNumberOfPresets()*KFrequencyStep + KFrequencyStep);
+    station.setPresetIndex( mPresetStorage->maxNumberOfPresets() );  
+    mPresetStorage->savePreset( *station.data_ptr() );
+    int r = mPresetStorage->presetCount();
+    // preset count must not increase
+    QVERIFY2(( mPresetStorage->presetCount() == mPresetStorage->maxNumberOfPresets()), "API:RadioPresetStorage testStessTest 2");
+    
+    for(int i = 0; i <= mPresetStorage->maxNumberOfPresets(); i++)
+    {
+        mPresetStorage->deletePreset( i );        
+    }  
+
+    // test deleting with invalid preset index
+    mPresetStorage->deletePreset( KInvalidPresetIndex );
+    QVERIFY2(( mPresetStorage->presetCount() == 0), "API:RadioPresetStorage testStessTest 3");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiopresetstorage/tsrc/t_radiopresetstorage.pro	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,52 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+TEMPLATE = app
+TARGET = t_radiopresetstorage
+
+symbian: {
+    TARGET.CAPABILITY = CAP_GENERAL_DLL
+    TARGET.SID = 0x101FF976 # Old visual radio uid
+}
+
+DEPENDPATH += . \
+    inc \
+    src
+INCLUDEPATH += . \
+    /epoc32/include/domain \
+    /epoc32/include/domain/middleware \
+    /epoc32/include/domain/applications \
+    /epoc32/include/osextensions \
+    /epoc32/include/middleware \
+    /epoc32/include/osextensions/stdapis/stlport \
+    stub/inc \
+    ../../../inc \
+    ../inc \
+    ../../commoninc \
+    ../../radioenginewrapper/inc \
+    ../../radiopresetstorage/inc \
+    ../../radiouiengine/inc \
+    ../../../../inc
+
+CONFIG += qtestlib
+
+symbian:LIBS += -lradiouiengine
+symbian:LIBS += -lradioenginewrapper
+symbian:LIBS += -lradiopresetstorage
+
+
+HEADERS += inc/t_radiopresetstorage.h
+SOURCES += src/t_radiopresetstorage.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/inc/radiocarouselmodel.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,81 @@
+/*
+* 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 RADIOCAROUSELMODEL_H
+#define RADIOCAROUSELMODEL_H
+
+// System includes
+#include <QAbstractListModel>
+
+// User includes
+#include "radiouiengineexport.h"
+#include "radio_global.h"
+
+// Forward declarations
+class RadioCarouselModelPrivate;
+class RadioUiEngine;
+class RadioStation;
+class RadioStationModel;
+
+class UI_ENGINE_DLL_EXPORT RadioCarouselModel : public QAbstractListModel
+{
+    Q_OBJECT
+    Q_DECLARE_PRIVATE_D( d_ptr, RadioCarouselModel )
+    Q_DISABLE_COPY( RadioCarouselModel )
+
+    friend class RadioUiEngine;
+    friend class RadioStationModelPrivate;
+    
+public:
+
+    ~RadioCarouselModel();
+
+// from base class QAbstractListModel
+
+    int rowCount( const QModelIndex& parent = QModelIndex() ) const;
+    QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const;
+
+// New functions
+
+    /*!
+     * Finds the closest station from the given frequency
+     */
+    RadioStation findClosest( const uint frequency, StationSkip::Mode mode );
+
+    /*!
+     * Returns the model index corresponding to the given frequency
+     */
+    QModelIndex modelIndexFromFrequency( uint frequency );
+
+private slots:
+
+    void removeFrequency( const QModelIndex& parent, int first, int last );
+
+private:
+
+    explicit RadioCarouselModel( RadioUiEngine& uiEngine, RadioStationModel& stationModel );
+
+private: // data
+
+    /**
+     * Unmodifiable pointer to the private implementation
+     */
+    RadioCarouselModelPrivate* const d_ptr;
+
+};
+
+#endif // RADIOCAROUSELMODEL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/inc/radiocarouselmodel_p.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef RADIOCAROUSELMODEL_P_H
+#define RADIOCAROUSELMODEL_P_H
+
+// System includes
+
+// Forward declarations
+class RadioCarouselModel;
+class RadioUiEngine;
+class RadioStationModel;
+
+class RadioCarouselModelPrivate
+{
+public:
+
+    explicit RadioCarouselModelPrivate( RadioCarouselModel* model,
+                                        RadioUiEngine& uiEngine,
+                                        RadioStationModel& stationModel );
+
+    ~RadioCarouselModelPrivate();
+
+public: // data
+
+    /**
+     * Pointer to the public class
+     * Not own.
+     */
+    RadioCarouselModel*          q_ptr;
+
+    /**
+     * Reference to the ui engine
+     */
+    RadioUiEngine&              mUiEngine;
+
+    RadioStationModel&          mStationModel;
+
+};
+
+#endif // RADIOCAROUSELMODEL_P_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/inc/radiocontrolservice.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef RADIOCONTROLSERVICE_H
+#define RADIOCONTROLSERVICE_H
+
+// System includes
+#ifndef BUILD_WIN32
+#   include <xqserviceprovider.h>
+#else
+#   include <QObject>
+typedef QObject XQServiceProvider;
+#endif
+
+// User includes
+
+// Forward declarations
+class RadioUiEngine;
+
+class RadioControlService : public XQServiceProvider
+{
+    Q_OBJECT
+
+public:
+
+    RadioControlService( RadioUiEngine& engine );
+    virtual ~RadioControlService();
+
+
+public slots:
+
+    void command( int commandId );
+
+private: // data
+
+    RadioUiEngine&  mUiEngine;
+
+};
+
+#endif // RADIOCONTROLSERVICE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/inc/radiohistoryitem.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,112 @@
+/*
+* 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 RADIOHISTORYITEM_H
+#define RADIOHISTORYITEM_H
+
+// System includes
+#include <QMetaType>
+#include <QObject>
+
+// User includes
+#include "radiouiengineexport.h"
+
+// Forward declarations
+class RadioHistoryItemPrivate;
+
+/*!
+ * Radio history item implements a song recognized from the radio broadcast
+ *
+ * Note! It is derived from QObject even though architecturally it shouldn't be.
+ * It is done only to satisfy the WINSCW build which doesn't export the destructor in UREL
+ * build. This causes mismatching def files and annoying warnings. Deriving from QObject fixes this
+ */
+class UI_ENGINE_DLL_EXPORT RadioHistoryItem : public QObject
+{
+public:
+
+    RadioHistoryItem();
+    RadioHistoryItem( const QString& artist, const QString& title );
+    RadioHistoryItem( const RadioHistoryItem& other );
+
+    ~RadioHistoryItem();
+
+    RadioHistoryItem& operator=( const RadioHistoryItem& other );
+
+    bool isValid() const;
+    void reset();
+
+    int id() const;
+
+    QString artist() const;
+    void setArtist( const QString& artist );
+
+    QString title() const;
+    void setTitle( const QString& title );
+
+    QString station() const;
+    void setStation( const QString& station );
+
+    uint frequency() const;
+    void setFrequency( uint frequency );
+
+    QString time() const;
+    void setCurrentTime();
+
+    bool isTagged() const;
+
+    bool isRecognizedByRds() const;
+
+private:
+
+    /**
+     * Decrements the reference count of the implicitly shared data.
+     * Data is deleted if no instance uses it anymore.
+     */
+    void decrementReferenceCount();
+
+private: // data
+
+    /**
+     * Pointer to the implicitly shared private implementation
+     * Own.
+     */
+    class RadioHistoryItemPrivate* mData;
+
+public:
+
+    /**
+     * Detach from the implicitly shared data
+     */
+    void detach();
+
+    /**
+     * Checks if the class is detached from implicitly shared data
+     * Required by many QT convenience functions for implicitly shared classes
+     */
+    bool isDetached() const;
+
+    typedef RadioHistoryItemPrivate* DataPtr;
+    inline DataPtr &data_ptr() { return mData; }
+
+};
+
+Q_DECLARE_TYPEINFO( RadioHistoryItem, Q_MOVABLE_TYPE );  // Can be moved around in memory by containers if necessary
+Q_DECLARE_SHARED( RadioHistoryItem )                     // Uses implicit sharing
+Q_DECLARE_METATYPE( RadioHistoryItem )                   // To be usable in a QVariant
+
+#endif // RADIOHISTORYITEM_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/inc/radiohistoryitem_p.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef RADIOHISTORYITEM_P_H
+#define RADIOHISTORYITEM_H
+
+// System includes
+#include <QString>
+#include <QDateTime>
+
+// User includes
+
+// Forward declarations
+class QSqlRecord;
+
+// Constants
+namespace RadioHistoryValue
+{
+    enum Name
+    {
+        Id,
+        Artist,
+        Title,
+        Station,
+        Frequency,
+        Tagged,
+        FromRds,
+        Time
+    };
+}
+
+class RadioHistoryItemPrivate
+{
+public:
+
+    RadioHistoryItemPrivate();
+    RadioHistoryItemPrivate( const QString& artist, const QString& title );
+
+    void init( const QString& artist, const QString& title );
+
+    void initFromRecord( const QSqlRecord& record );
+
+public: // data
+
+    /**
+     * Reference count used for implicit sharing.
+     * Has to be named "ref" instead having the 'm' prefix like all other member variables in Radio
+     * This is because convenience functions like qAtomicAssign() expect it to be named "ref"
+     */
+    QAtomicInt      ref;
+
+    int             mId;
+
+    QString         mArtist;
+
+    QString         mTitle;
+
+    QString         mStation;
+
+    QDateTime       mTime;
+
+    uint            mFrequency;
+
+    bool            mTagged;
+
+    bool            mFromRds;
+
+};
+
+#endif // RADIOHISTORYITEM_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/inc/radiohistorymodel.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,108 @@
+/*
+* 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 RADIOHISTORYMODEL_H
+#define RADIOHISTORYMODEL_H
+
+// System includes
+#include <QAbstractListModel>
+
+// User includes
+#include "radiouiengineexport.h"
+#include "radiohistoryitem.h"
+
+// Forward declarations
+class RadioHistoryModelPrivate;
+class RadioUiEngine;
+class RadioStation;
+class QIcon;
+class RadioHistoryItem;
+
+class UI_ENGINE_DLL_EXPORT RadioHistoryModel : public QAbstractListModel
+{
+    Q_OBJECT
+    Q_DECLARE_PRIVATE_D( d_ptr, RadioHistoryModel )
+    Q_DISABLE_COPY( RadioHistoryModel )
+
+    friend class RadioUiEngine;
+    friend class RadioUiEnginePrivate;
+    friend class RadioStationModelPrivate;
+
+    friend class RadioHistoryView;  // TEMPORARY TEST CODE, REMOVE
+
+public:
+
+    ~RadioHistoryModel();
+
+    enum HistoryRole
+    {
+        HistoryItemRole = Qt::UserRole + 100,
+        SetFavoriteRole
+    };
+
+// from base class QAbstractListModel
+
+    int rowCount( const QModelIndex& parent = QModelIndex() ) const;
+    QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const;
+
+// New functions
+
+    /*!
+     * Sets the icons to be used in the list
+     */
+    void setIcons( const QIcon& nonTaggedIcon, const QIcon& taggedIcon );
+
+    bool isCurrentSongRecognized() const;
+    void setShowDetails( bool showDetails );
+    void setShowTagged( bool showTagged );
+    void toggleTagging( const RadioHistoryItem& item, const int row );
+
+    RadioHistoryItem itemAtIndex( const QModelIndex& index ) const;
+
+signals:
+
+    void itemAdded();
+    void currentSongReset();
+
+public slots:
+
+    void resetCurrentSong();
+    void removeAll();
+
+private:
+
+    explicit RadioHistoryModel( RadioUiEngine& uiEngine );
+
+    void addItem( const QString& artist, const QString& title, const RadioStation& station );
+
+    void clearRadioTextPlus();
+    void addRadioTextPlus( int rtClass, const QString& rtItem, const RadioStation& station );
+
+    void reportChangedData( int start, int end = -1 );
+
+    void emitItemAdded();
+
+private: // data
+
+    /**
+     * Unmodifiable pointer to the private implementation
+     */
+    RadioHistoryModelPrivate* const d_ptr;
+
+};
+
+#endif // RADIOHISTORYMODEL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/inc/radiohistorymodel_p.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,109 @@
+/*
+* 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 RADIOHISTORYMODEL_P_H
+#define RADIOHISTORYMODEL_P_H
+
+// System includes
+#include <QList>
+#include <QString>
+#include <QScopedPointer>
+#include <QIcon>
+#include <QSqlQuery>
+
+// User includes
+#include "radiohistoryitem.h"
+
+// Forward declarations
+class RadioHistoryModel;
+class RadioUiEngine;
+class RadioHistoryItem;
+class QSqlDatabase;
+class RadioStation;
+class QStringList;
+class QSqlQueryModel;
+
+class RadioHistoryModelPrivate
+{
+public:
+
+    explicit RadioHistoryModelPrivate( RadioHistoryModel* model, RadioUiEngine& uiEngine );
+
+    ~RadioHistoryModelPrivate();
+
+    bool connectToDatabase();
+
+    void addItem( const QString& artist, const QString& title, const RadioStation& station, bool fromRds = true );
+
+    int rowCount() const;
+    QVariant data( const int row, const int role ) const;
+
+    void removeAll();
+
+    enum ViewMode{ ShowAll, ShowTagged };
+    void setViewMode( ViewMode mode );
+
+    void toggleTagging( const RadioHistoryItem& item, const int row );
+
+    RadioHistoryItem itemAtIndex( const QModelIndex& index ) const;
+
+private:
+
+    void refreshModel();
+    QSqlQuery beginTransaction();
+    enum Operation{ NoOp, InsertRows, RemoveRows, ChangeData };
+    void commitTransaction( QSqlQuery& query, Operation operation, int start, int end = -1 );
+
+public: // data
+
+    /**
+     * Pointer to the public class
+     * Not own.
+     */
+    RadioHistoryModel*              q_ptr;
+
+    /**
+     * Reference to the ui engine
+     */
+    RadioUiEngine&                  mUiEngine;
+
+    QScopedPointer<QSqlDatabase>    mDatabase;
+
+    QScopedPointer<QSqlQueryModel>  mQueryModel;
+
+    QString                         mRtItemHolder;
+    int                             mRtItemClass;
+
+    bool                            mTopItemIsPlaying;
+
+    bool                            mShowDetails;
+
+    /**
+     * Non Tagged icon
+     */
+    QIcon                           mNonTaggedIcon;
+
+    /**
+     * Tagged icon
+     */
+    QIcon                           mTaggedIcon;
+
+    ViewMode                        mViewMode;
+
+};
+
+#endif // RADIOHISTORYMODEL_P_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/inc/radiomonitorservice.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef RADIOMONITORSERVICE_H
+#define RADIOMONITORSERVICE_H
+
+// System includes
+#include <xqserviceprovider.h>
+
+// User includes
+#include "radioservicedef.h"
+#include "radioenginewrapperobserver.h"
+
+// Forward declarations
+class RadioUiEnginePrivate;
+class RadioStation;
+
+class RadioMonitorService : public XQServiceProvider
+                          , public RadioEngineWrapperObserver
+{
+    Q_OBJECT
+
+public:
+
+    RadioMonitorService( RadioUiEnginePrivate& engine );
+    virtual ~RadioMonitorService();
+
+    void init();
+
+    void notifySong( const QString& song );
+
+public slots:
+
+    void requestNotifications();    // Slot called by Qt Highway
+    void requestAllData();          // Slot called by Qt Highway
+
+private slots:
+
+    void notifyRadioStatus();
+    void notifyFavoriteCount();
+    void notifyStationChange( const RadioStation& station );
+
+private:
+    
+// from base class RadioEngineWrapperObserver
+
+    void tunedToFrequency( uint frequency, int reason );
+
+// New functions
+
+    RadioStatus::Status determineRadioStatus() const;
+    void notify( const QVariant& notification );
+    void notifyList( const QVariantList& list );
+    
+private: // data
+
+    RadioUiEnginePrivate&   mUiEngine;
+
+    QList<int>              mRequestIndexes;
+    
+    RadioStatus::Status     mRadioStatus;
+
+};
+
+#endif // RADIOMONITORSERVICE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/inc/radiomonitorservice_win32.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,51 @@
+/*
+* 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 RADIOMONITORSERVICE_H
+#define RADIOMONITORSERVICE_H
+
+// System includes
+#include <QObject>
+
+// User includes
+#include "radioservicedef.h"
+
+// Forward declarations
+class RadioUiEnginePrivate;
+
+class RadioMonitorService : public QObject
+{
+    Q_OBJECT
+
+public:
+
+    RadioMonitorService( RadioUiEnginePrivate& engine );
+    virtual ~RadioMonitorService();
+
+    void init();
+
+    void notifySong( const QString& song );
+
+private:
+    
+private: // data
+
+    RadioUiEnginePrivate&  mUiEngine;
+
+};
+
+#endif // RADIOMONITORSERVICE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/inc/radioscannerengine.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,95 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef RADIOSCANNERENGINE_H
+#define RADIOSCANNERENGINE_H
+
+// System includes
+#include <QObject>
+#include <QMap>
+
+// User includes
+#include "radiouiengineexport.h"
+
+// Forward declarations
+class RadioScannerEnginePrivate;
+class RadioUiEnginePrivate;
+class RadioStationHandlerIf;
+class RadioStation;
+
+// Constants
+
+// Class declaration
+class UI_ENGINE_DLL_EXPORT RadioScannerEngine : public QObject
+    {
+    Q_OBJECT
+    Q_DECLARE_PRIVATE_D( d_ptr, RadioScannerEngine )
+    Q_DISABLE_COPY( RadioScannerEngine )
+
+    friend class RadioUiEngine;
+    
+public:
+
+    explicit RadioScannerEngine( RadioUiEnginePrivate& uiEngine );
+    ~RadioScannerEngine();
+
+// New functions
+
+    /*!
+     * Starts the scanning from minimum frequency
+     */
+    void startScanning();
+
+    /*!
+     * Continues the scanning upwards from current frequency
+     */
+    void continueScanning();
+
+    /*!
+     * Checks if the scanning is ongoing
+     */
+    bool isScanning() const;
+
+    /*!
+     * Cancels the scanning process
+     */
+    void cancel();
+
+    /*!
+     * Adds a new station that was found
+     * @param frequency Frequency of the found station
+     */
+    void addScannedFrequency( const uint frequency );
+
+signals:
+
+    void stationFound( const RadioStation& station );
+
+private:
+
+    void emitStationFound( const RadioStation& station );
+
+private: // data
+
+    /**
+     * Unmodifiable pointer to the private implementation
+     */
+    RadioScannerEnginePrivate* const d_ptr;
+
+    };
+
+#endif // RADIOSCANNERENGINE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/inc/radioscannerengine_p.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,80 @@
+/*
+* 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 RADIOSCANNERENGINE_P_H_
+#define RADIOSCANNERENGINE_P_H_
+
+#include <QObject>
+#include <QMap>
+
+// User includes
+#include "radioenginewrapperobserver.h"
+
+// Forward declarations
+class RadioScannerEngine;
+class RadioUiEnginePrivate;
+class RadioStationHandlerIf;
+class RadioStation;
+class RadioEngineWrapper;
+
+// Constants
+
+// Class declaration
+class RadioScannerEnginePrivate : public RadioEngineWrapperObserver
+    {
+    Q_DECLARE_PUBLIC( RadioScannerEngine )
+    Q_DISABLE_COPY( RadioScannerEnginePrivate )
+
+public:
+
+    RadioScannerEnginePrivate( RadioScannerEngine* scanner, RadioUiEnginePrivate& uiEngine );
+    virtual ~RadioScannerEnginePrivate();
+
+private:
+
+// from base class RadioEngineWrapperObserver
+
+    void tunedToFrequency( uint frequency, int reason );
+
+// New functions
+
+    void addFrequencyAndReport( const uint frequency );
+
+private: // data
+
+    /**
+     * Pointer to the public class
+     * Not own.
+     */
+    RadioScannerEngine*     q_ptr;
+
+    RadioUiEnginePrivate&   mUiEngine;
+
+    /**
+     * Last scanned frequency. Used to know when the scanning has looped around the
+     * frequency band and it should stop
+     */
+    uint                    mLastFoundFrequency;
+
+    bool                    mMutedByScanner;
+
+    bool                    mIsScanning;
+
+    };
+
+
+#endif // RADIOSCANNERENGINE_P_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/inc/radiostation.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,232 @@
+/*
+* 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 RADIOSTATION_H_
+#define RADIOSTATION_H_
+
+// System includes
+#include <QString>
+#include <QMetaType>
+#include <QObject>
+
+// User includes
+#include "radiouiengineexport.h"
+#include "radio_global.h"
+
+// Constants
+const int KLastCallSignCharCode = 25;
+const uint KThreeLetterCallSignCount = 72;
+const uint KKxxxCallSignPiFirst = 0x1000;
+const uint KWxxxCallSignPiFirst = 0x54A8;
+const uint KWxxxCallSignPiLast = 0x994F;
+const uint KxxxCallSignPiFirst = 0x9950;
+const uint KxxxCallSignPiLast = 0x99B9;
+
+// Forward declarations
+class RadioStationPrivate;
+
+// Class declaration
+
+/*!
+ * RadioStation is a data container that holds all information of a radio station.
+ * It is implicitly shared to make it cheap to copy and pass around as a signal parameter.
+ * It uses the "shared null" idiom to initialize empty instances quickly and efficiently.
+ *
+ * Note! It is derived from QObject even though architecturally it shouldn't be.
+ * It is done only to satisfy the WINSCW build which doesn't export the destructor in UREL
+ * build. This causes mismatching def files and annoying warnings. Deriving from QObject fixes this
+ */
+class UI_ENGINE_DLL_EXPORT RadioStation : public QObject
+{
+    friend class RadioStationModel;
+    friend class RadioStationModelPrivate;
+    friend class TestRadioUiEngine;
+    friend class TestRadioPresetStorage;
+    
+public:
+
+    /**
+     * Flags to indicate how the RadioStation has changed since last save or reset.
+     * Declared to use QFlags<> to ease flag usage and to enforce type safety
+     */
+    enum ChangeFlag
+    {
+         NoChange               = 0
+        ,PersistentDataChanged  = 1 << 0
+        ,NameChanged            = 1 << 1
+        ,FavoriteChanged        = 1 << 2
+        ,GenreChanged           = 1 << 3
+        ,UrlChanged             = 1 << 4
+        ,TypeChanged            = 1 << 5
+        ,PiCodeChanged          = 1 << 6
+        ,PsTypeChanged          = 1 << 7
+        ,RadioTextChanged       = 1 << 8
+        ,DynamicPsChanged       = 1 << 9
+    };
+    Q_DECLARE_FLAGS( Change, ChangeFlag )
+
+    /**
+     * Flags ot indicate station type.
+     * Declared to use QFlags<> to ease flag usage and to enforce type safety
+     */
+    enum TypeFlag
+    {
+       Favorite         = 1 << 0,
+       LocalStation     = 1 << 1,
+       PreDefined       = 1 << 2,
+       Temporary        = 1 << 3
+    };
+    Q_DECLARE_FLAGS( Type, TypeFlag )
+
+    /**
+     * Flag to indiate whether or not station uses dynamic PS and if the check has been performed
+     * Declared to use QFlags<> to ease flag usage and to enforce type safety
+     */
+    enum PsTypeFlag
+    {
+        Unknown,
+        Dynamic,
+        Static
+    };
+    Q_DECLARE_FLAGS( PsType, PsTypeFlag )
+
+    /**
+     * Magical values used as preset indexes to signify certain conditions.
+     * NotFound means that a find function could not find a station
+     * Invalid means that the station instance has not been initialized
+     */
+    enum PresetFlag { NotFound = -1, Invalid = -100, SharedNull = -200 };
+
+    /**
+     * Static convenience function to parse a frequency
+     */
+    static QString parseFrequency( uint frequency );
+
+    RadioStation();
+    RadioStation( const RadioStation& other );
+
+    ~RadioStation();
+
+    RadioStation& operator=( const RadioStation& other );
+
+public:
+
+    explicit RadioStation( int presetIndex, uint frequency );
+
+    void reset();
+    void setChangeFlags( Change flags );
+
+    // Setters for persistent data
+    void setPresetIndex( int presetIndex );
+    void setFrequency( uint frequency );
+    void setName( const QString& name );
+    void setGenre( const int genre );
+    void setUrl( const QString& url );
+    bool setPiCode( int piCode, RadioRegion::Region region );
+
+    // Setters for non-persistent data
+    void setPsType( PsType psType );
+    void setRadioText( const QString& radioText );
+    void setRadioTextPlus( const int rtPlusClass, const QString& rtPlusItem );
+    void setDynamicPsText( const QString& dynamicPsText );
+
+public: // Getters and setters
+
+    // Setters & Getters for persistent data
+
+    bool isValid() const;
+
+    QString name() const;
+    void setUserDefinedName( const QString& name );
+    bool isRenamed() const;
+
+    int genre() const;
+
+    QString frequencyMhz() const;
+    uint frequency() const;
+    int presetIndex() const;
+
+    void setFavorite( bool favorite );
+    bool isFavorite() const;
+
+    QString url() const;
+
+    bool hasPiCode() const;
+    bool hasRds() const;
+
+    void setType( RadioStation::Type type );
+    void unsetType( RadioStation::Type type );
+    bool isType( RadioStation::Type type ) const;
+
+    // Getters for non-persistent data
+
+    PsType psType() const;
+    QString radioText() const;
+    QString dynamicPsText() const;
+    Change changeFlags() const;
+    bool hasDataChanged( Change flags ) const;
+    bool hasChanged() const;
+    void resetChangeFlags();
+
+private:
+
+    /**
+     * Decrements the reference count of the implicitly shared data.
+     * Data is deleted if no instance uses it anymore.
+     */
+    void decrementReferenceCount();
+
+    // Methods for converting PI code into call sign
+    QString piCodeToCallSign( uint programmeIdentification );
+    QString iterateCallSign( int piBase, int programmeIdentification );
+    QString callSignString( uint programmeIdentification );
+    char callSignChar( uint decimalValue );
+
+private: // data
+
+    /**
+     * Pointer to the implicitly shared private implementation
+     * Own.
+     */
+    class RadioStationPrivate* mData;
+
+public:
+
+    /**
+     * Detach from the implicitly shared data
+     */
+    void detach();
+
+    /**
+     * Checks if the class is detached from implicitly shared data
+     * Required by many QT convenience functions for implicitly shared classes
+     */
+    bool isDetached() const;
+
+    typedef RadioStationPrivate* DataPtr;
+    inline DataPtr &data_ptr() { return mData; }
+
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS( RadioStation::Change )
+Q_DECLARE_OPERATORS_FOR_FLAGS( RadioStation::Type )
+
+Q_DECLARE_TYPEINFO( RadioStation, Q_MOVABLE_TYPE );  // Can be moved around in memory by containers if necessary
+Q_DECLARE_SHARED( RadioStation )                     // Uses implicit sharing
+Q_DECLARE_METATYPE( RadioStation )                   // To be usable in a QVariant
+
+#endif // RADIOSTATION_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/inc/radiostation_p.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,182 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef RADIOSTATIONINFO_P_H_
+#define RADIOSTATIONINFO_P_H_
+
+// System includes
+#include <QTime>
+
+// User includes
+#include "radiostation.h"
+#include "radiostationif.h"
+
+// Class declaration
+class RadioStationPrivate : public RadioStationIf
+{
+public:
+
+    explicit RadioStationPrivate( int presetIndex = RadioStation::Invalid, uint frequency = 0 );
+    explicit RadioStationPrivate( RadioStation::PresetFlag flag );
+
+    virtual ~RadioStationPrivate();
+
+    void init( int presetIndex, uint frequency = 0 );
+
+private:
+
+// from base class RadioStationIf
+
+    int presetIndex() const;
+    void setPresetIndex( int presetIndex );
+    uint frequency() const;
+    void setFrequency( uint frequency );
+    QString name() const;
+    void setName( QString name );
+    bool isRenamedByUser() const;
+    void setRenamedByUser( bool renamed );
+    int genre() const;
+    void setGenre( int genre );
+    QString url() const;
+    void setUrl( QString url );
+    int piCode() const;
+    void setPiCode( int piCode );
+    bool isFavorite() const;
+    void setFavorite( bool favorite );
+    bool isLocalStation() const;
+    void setLocalStation( bool localStation );
+
+public: // data
+
+    /**
+     * Reference count used for implicit sharing.
+     * Has to be named "ref" instead having the 'm' prefix like all other member variables in Radio
+     * This is because convenience functions like qAtomicAssign() expect it to be named "ref"
+     */
+    QAtomicInt                  ref;
+
+    // ========================================================================
+    // Persistent data. Saved to Central repository
+    // ========================================================================
+
+    /**
+     * Station frequency. The most important bit of information about a radio station.
+     * Is checked to be non-null in the isValid() function
+     */
+    uint                        mFrequency;
+
+    /**
+     * Station index in the Preset Utility.
+     * Negative values signify an invalid RadioStation that has not and will not be saved.
+     * Initialized to -100 by default to indicate and invalid station.
+     */
+    int                         mPresetIndex;
+
+    /**
+     * Station name. Contains a name that is set in one of the following ways:
+     *  1) Received through RDS as the stations PS name and station does not use dynamic PS
+     *  2) Entered by the user. In this case the mRenamedByUser flag will be set and the name
+     *     cannot be changed until the user removes the renaming.
+     *  3) Callsign calculated from the PI code can be set as the station name if the station
+     *     does not send RDS information and the current region is America
+     */
+    QString                     mName;
+
+    /**
+     * Flag to indicate whether or not the user has renamed the station
+     */
+    bool                        mRenamedByUser;
+
+    /**
+     * Station genre received through RDS
+     */
+    int                         mGenre;
+
+    /**
+     * Station URL. Can be e.g. a web address to the radio stations homepage
+     */
+    QString                     mUrl;
+
+    /**
+     * Stations PI code. Only used in the America region to calculate the Callsign if station
+     * does not use RDS to broadcast PS name
+     */
+    int                         mPiCode;
+
+    /**
+     * Station type. Used by the application mainly to filter out certain stations depending
+     * on the users preference to see all locally audible stations or all favorite stations.
+     * Can have any combination of the following flags:
+     *  - Favorite      The station is a favorite of the user.
+     *  - LocalStation  The station was found in the last scan and should be audible in the current location
+     *  - Temporary     Special flag to mark one RadioStation instance that is used to store
+     *                  information of a manually tuned frequency that has not been saved by the user.
+     */
+    RadioStation::Type          mType;    // Station type, favorite or local station or neither
+
+    // ========================================================================
+    // Non-persistent data. Only kept in memory
+    // ========================================================================
+
+    /**
+     * Radio station PS name type. Some radio stations use the PS name broadcasting against the
+     * official RDS standard rules to broadcast advertisements. The ads are sent by changing the
+     * PS name in relatively rapid succession. The RDS standard specifies that a station should
+     * only use the PS name to broadcast a static station name.
+     * The FM Radio application attempts to determine if the station uses dynamic PS or not and
+     * stores the information here. Stations with a dynamic PS are treated differently in the UI and the
+     * name is never saved to Central Repository because it would only contain a part of an advertisement.
+     * Can have one of the following values:
+     *  - Unknown   Dynamic PS check has not been done so it is unknown if the station uses dynamic PS
+     *  - Dynamic   The check has been done and station has been found to use dynamic PS
+     *  - Static    The check has been done and the station has been found not to use dynamic PS
+     */
+    RadioStation::PsType        mPsType;
+
+    /**
+     * Stores the Radio Text received through RDS. Can be either normal Radio Text or Radio Text Plus
+     * where the tags have been parsed. Parsed Radio Text Plus is stored in HTML form, the normal Radio Text
+     * is stored as plain text.
+     */
+    QString                     mRadioText;
+
+    /**
+     * Holder for the ads sent by using dynamic PS. Holds one part of the ad at a time.
+     */
+    QString                     mDynamicPsText;
+
+    /**
+     * Internal book keeping used to determine which member variables have been changed since last save
+     * or reset. Used to decide which signals should be sent by the RadioStationModel when the station is saved.
+     */
+    RadioStation::Change        mChangeFlags;
+
+    /**
+     * Keeps track of station call sign calculation state
+     */
+    bool                        mCallSignCheckDone;
+
+    /**
+     * Time of the last PS name change. Used to check if the station changes its PS name too often.
+     * In bad RDS coverage a station using dynamic PS might be incorrectly determined to use static PS.
+     * This is a corrective effort to change that decision if the name changes too often.
+     */
+    QTime                       mLastPsNameChangeTime;
+
+};
+
+#endif // RADIOSTATIONINFO_P_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/inc/radiostationfiltermodel.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,82 @@
+/*
+* 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 RADIOSTATIONFILTERMODEL_H_
+#define RADIOSTATIONFILTERMODEL_H_
+
+// System includes
+#include <QSortFilterProxyModel>
+#include <QMap>
+
+// User includes
+#include "radiouiengineexport.h"
+#include "radiostation.h"
+
+// Forward declarations
+class RadioUiEngine;
+
+class UI_ENGINE_DLL_EXPORT RadioStationFilterModel : public QSortFilterProxyModel
+{
+public:
+
+    RadioStationFilterModel( RadioUiEngine& uiEngine, QObject* parent = 0 );
+
+    ~RadioStationFilterModel();
+
+// from QAbstractItemModel
+
+    int rowCount( const QModelIndex& parent = QModelIndex() ) const;
+    QModelIndex index( int row, int column,
+                       const QModelIndex &parent = QModelIndex() ) const;
+    QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const;
+
+// New functions
+
+    void setTypeFilter( RadioStation::Type filter );
+
+    /*!
+     * Returns the model index corresponding to the given frequency
+     */
+    QModelIndex modelIndexFromFrequency( uint frequency );
+
+    void setCyclic( bool cyclic );
+
+    bool hasLooped( const QModelIndex& index ) const;
+
+    QModelIndex realIndex( const QModelIndex& shadowIndex ) const;
+
+    bool isEqual( const QModelIndex& first, const QModelIndex& second ) const;
+
+private:
+
+// from base class QSortFilterProxyModel
+
+    bool filterAcceptsRow( int sourceRow, const QModelIndex& sourceParent ) const;
+
+private: // data
+
+    RadioUiEngine&      mUiEngine;
+
+    RadioStation::Type  mFilter;
+
+    bool                mIsCyclic;
+
+    QMap<QModelIndex,QModelIndex>   mShadowIndexes;
+
+};
+
+#endif // RADIOSTATIONFILTERMODEL_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/inc/radiostationmodel.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,221 @@
+/*
+* 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 RADIOSTATIONMODEL_H_
+#define RADIOSTATIONMODEL_H_
+
+// System includes
+#include <QAbstractListModel>
+#include <QMap>
+
+// User includes
+#include "radio_global.h"
+#include "radiouiengineexport.h"
+#include "radiostation.h"
+
+// Forward declarations
+class RadioStationModelPrivate;
+class RadioPresetStorage;
+class RadioStationHandlerIf;
+class RadioEngineWrapper;
+class RadioStation;
+class RadioUiEnginePrivate;
+class QIcon;
+
+// Constants
+typedef QMap<uint,RadioStation> Stations;
+
+// Class declaration
+class UI_ENGINE_DLL_EXPORT RadioStationModel : public QAbstractListModel
+{
+    Q_OBJECT
+    Q_DECLARE_PRIVATE_D( d_ptr, RadioStationModel )
+    Q_DISABLE_COPY( RadioStationModel )
+
+public:
+
+    enum RadioRole
+    {
+        RadioStationRole = Qt::UserRole + 1,
+        ToggleFavoriteRole
+    };
+
+    enum DetailFlag
+    {
+        Minimal     = 1 << 0,
+        ShowIcons   = 1 << 1,
+        ShowGenre   = 1 << 2
+    };
+    Q_DECLARE_FLAGS( Detail, DetailFlag )
+
+    explicit RadioStationModel( RadioUiEnginePrivate& uiEngine );
+
+    ~RadioStationModel();
+
+// from base class QAbstractListModel
+
+    Qt::ItemFlags flags ( const QModelIndex& index ) const;
+    int rowCount( const QModelIndex& parent = QModelIndex() ) const;
+    QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const;
+    bool setData( const QModelIndex& index, const QVariant& value, int role = Qt::EditRole );
+
+// New functions
+
+    /*!
+     * Called by the engine to initialize the list with given amount of presets
+     */
+    void initialize( RadioPresetStorage* storage, RadioEngineWrapper* wrapper );
+
+    /*!
+     * Sets the icons to be used in the lists
+     */
+    void setIcons( const QIcon& favoriteIcon, const QIcon& nowPlayingIcon );
+
+    /*!
+     * Returns a reference to the station handler interface
+     */
+    RadioStationHandlerIf& stationHandlerIf();
+
+    /*!
+     * Returns a reference to the underlying QList so that it can be easily looped
+     */
+    const Stations& list() const;
+
+    /*!
+     * Returns the station at the given index.
+     * The station is returned by value, but it is cheap because it is implicitly shared
+     */
+    RadioStation stationAt( int index ) const;
+
+    /*!
+     * Functions to find stations by frequency
+     */
+    bool findFrequency( uint frequency, RadioStation& station );
+
+    /*!
+     * Functions to find stations by preset index
+     */
+    int findPresetIndex( int presetIndex );
+    int findPresetIndex( int presetIndex, RadioStation& station );
+
+    /*!
+     * Finds the closest station from the given frequency
+     */
+    RadioStation findClosest( const uint frequency, StationSkip::Mode mode );
+
+    /*!
+     * Functions to remove stations
+     */
+    void removeByFrequency( uint frequency );
+    void removeByPresetIndex( int presetIndex );
+    void removeStation( const RadioStation& station );
+
+    /**
+     * Removes all stations
+     */
+    enum RemoveMode{ RemoveAll, RemoveLocalStations, RemoveFavorites  };
+    void removeAll( RemoveMode mode = RemoveAll );
+
+    /*!
+     * Functions to add and save stations
+     */
+    void addStation( const RadioStation& station );
+    void saveStation( RadioStation& station );
+
+    /*!
+     * Function to check the number of favorite stations
+     */
+    int favoriteCount();
+
+    /*!
+     * Convenience functions to change common settings
+     */
+    void setFavoriteByFrequency( uint frequency, bool favorite );
+    void setFavoriteByPreset( int presetIndex, bool favorite );
+    void renameStation( int presetIndex, const QString& name );
+    void setFavorites( const QModelIndexList& favorites );
+
+    /*!
+     * Functions to init and access the currently tuned station
+     */
+    RadioStation& currentStation();
+    const RadioStation& currentStation() const;
+
+    /*!
+     * Sets the model detail level
+     */
+    void setDetail( Detail level );
+
+    /*!
+     * Returns a list of radio stations in the given frequency range
+     */
+    QList<RadioStation> stationsInRange( uint minFrequency, uint maxFrequency );
+
+    /*!
+     * Returns the model index corresponding to the given frequency
+     */
+    QModelIndex modelIndexFromFrequency( uint frequency );
+
+signals:
+
+    void stationDataChanged( const RadioStation& station );
+    void radioTextReceived( const RadioStation& station );
+    void dynamicPsChanged( const RadioStation& station );
+    void favoriteChanged( const RadioStation& station );
+
+private slots:
+
+    /*!
+     * Timer timeout slot to indicate that the dynamic PS check has ended
+     */
+    void dynamicPsCheckEnded();
+
+private:
+
+// New functions
+
+    /*!
+     * Checks the given station and emits signals based on what member variables had been changed
+     * since the last save or reset.
+     */
+    void emitChangeSignals( const RadioStation& station, RadioStation::Change flags );
+
+    void emitDataChanged( const RadioStation& station );
+
+    /*!
+     * Finds an unused preset index
+     */
+    int findUnusedPresetIndex();
+
+    /**
+     * Used by the RDS data setters to find the correct station where the data is set
+     * First tries the currentStation variable and if the frequency doesn't match, finds the right one
+     */
+    RadioStation findCurrentStation( uint frequency );
+
+private: // data
+
+    /**
+     * Unmodifiable pointer to the private implementation
+     */
+    RadioStationModelPrivate* const d_ptr;
+
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS( RadioStationModel::Detail )
+
+#endif // RADIOSTATIONMODEL_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/inc/radiostationmodel_p.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,141 @@
+/*
+* 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 RADIOSTATIONMODEL_P_H_
+#define RADIOSTATIONMODEL_P_H_
+
+// System includes
+#include <QList>
+#include <QMap>
+#include <QScopedPointer>
+#include <QIcon>
+
+// User includes
+#include "radioenginewrapperobserver.h"
+#include "radiostationhandlerif.h"
+
+// Forward declarations
+class RadioUiEnginePrivate;
+class RadioPresetStorage;
+class RadioEngineWrapper;
+class QTimer;
+
+// Class declaration
+class RadioStationModelPrivate : public RadioStationHandlerIf
+                               , public RadioEngineWrapperObserver
+{
+    Q_DECLARE_PUBLIC( RadioStationModel )
+    Q_DISABLE_COPY( RadioStationModelPrivate )
+
+public:
+
+    explicit RadioStationModelPrivate( RadioStationModel* model, RadioUiEnginePrivate& uiEngine );
+
+    virtual ~RadioStationModelPrivate();
+
+private:
+
+// from base class RadioStationHandlerIf
+
+    uint currentFrequency() const;
+    int currentPresetIndex() const;
+    void setCurrentStation( uint frequency );
+    bool containsFrequency( uint frequency );
+    bool containsPresetIndex( int presetIndex );
+    void startDynamicPsCheck();
+    void addScannedFrequency( uint frequency );
+    void setCurrentPsName( uint frequency, const QString& name );
+    void setCurrentRadioText( uint frequency, const QString& radioText );
+    void setCurrentRadioTextPlus( uint frequency, int rtClass, const QString& rtItem );
+    void setCurrentPiCode( uint frequency, int piCode );
+    void setCurrentGenre( uint frequency, int genre );
+
+// from base class RadioEngineWrapperObserver
+
+    void tunedToFrequency( uint frequency, int reason );
+
+// New functions
+
+    void doSaveStation( RadioStation& station, bool persistentSave = true );
+
+    QList<RadioStation> favorites() const;
+
+private: // data
+
+    /**
+     * Pointer to the public class
+     * Not own.
+     */
+    RadioStationModel*          q_ptr;
+
+    /**
+     * Reference to the ui engine
+     */
+    RadioUiEnginePrivate&       mUiEngine;
+
+    /**
+     * Pointer to the preset storage
+     */
+    RadioPresetStorage*         mPresetStorage;
+
+    /**
+     * Pointer to the radio engine wrapper
+     */
+    RadioEngineWrapper*         mWrapper;
+
+    /**
+     * List of station items
+     */
+    Stations                    mStations;
+
+    /**
+     * Station used to store information of manually tuned frequencies
+     */
+    RadioStation                mManualStation;
+
+    /**
+     * Pointer to the current station
+     * Not own.
+     */
+    RadioStation*               mCurrentStation;
+
+    /**
+     * Dynamic PS timer
+     * Own.
+     */
+    QScopedPointer<QTimer>      mDynamicPsTimer;
+
+    /**
+     * Level of detail shown in Qt::DisplayRole and Qt::DecorationRole roles
+     */
+    RadioStationModel::Detail   mDetailLevel;
+
+    /**
+     * Pointer to favorite icon.
+     * Not own.
+     */
+    QIcon                       mFavoriteIcon;
+
+    /**
+     * Pointer to the now playing marker icon
+     * Not own.
+     */
+    QIcon                       mNowPlayingIcon;
+
+};
+
+#endif // RADIOSTATIONMODEL_P_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/inc/radiouiengine.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,172 @@
+/*
+* 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 RADIOUIENGINE_H_
+#define RADIOUIENGINE_H_
+
+// System includes
+#include <QObject>
+#include <QString>
+
+// User includes
+#include "radiouiengineexport.h"
+#include "radio_global.h"
+
+// Forward declarations
+class RadioUiEnginePrivate;
+class RadioStationModel;
+class RadioSettingsIf;
+class RadioStation;
+class RadioHistoryModel;
+class RadioHistoryItem;
+class RadioCarouselModel;
+class RadioStationFilterModel;
+class RadioScannerEngine;
+class RadioMonitorService;
+
+namespace GenreTarget
+{
+    enum Target{
+        Carousel,
+        StationsList,
+        HomeScreen
+    };
+}
+
+
+class UI_ENGINE_DLL_EXPORT RadioUiEngine : public QObject
+{
+    Q_OBJECT
+    Q_DECLARE_PRIVATE_D( d_ptr, RadioUiEngine )
+    Q_DISABLE_COPY( RadioUiEngine )
+
+    friend class RadioScannerEngine;
+
+public:
+
+    /**
+     * Static functions that are used before the ui engine is created
+     */
+    static bool isOfflineProfile();
+    static uint lastTunedFrequency();
+
+    RadioUiEngine( QObject* parent = 0 );
+    ~RadioUiEngine();
+
+    bool isInitialized() const;
+
+    bool init();
+
+    bool isFirstTimeStart();
+
+    /**
+     * Getters for things owned by the engine
+     */
+    RadioSettingsIf& settings();
+    RadioStationModel& stationModel();
+    RadioHistoryModel& historyModel();
+    RadioStationFilterModel* createNewFilterModel( QObject* parent = 0 );
+    RadioCarouselModel* carouselModel();
+    RadioScannerEngine* scannerEngine();
+
+    bool isRadioOn() const;
+    bool isScanning() const;
+    bool isMuted() const;
+    bool isAntennaAttached() const;
+    bool isUsingLoudspeaker() const;
+
+    RadioRegion::Region region() const;
+    uint currentFrequency() const;
+    uint minFrequency() const;
+    uint maxFrequency() const;
+    uint frequencyStepSize() const;
+
+    void setMute( bool muted );
+
+    QList<RadioStation> stationsInRange( uint minFrequency, uint maxFrequency );
+
+    QString genreToString( int genre, GenreTarget::Target target );
+
+    bool isSongRecognitionAppAvailable();
+
+    void addRecognizedSong( const QString& artist, const QString& title, const RadioStation& station );
+
+    uint skipStation( StationSkip::Mode mode, uint startFrequency = 0 );
+
+    enum MusicStore{ OviStore, OtherStore };
+    void openMusicStore( const RadioHistoryItem& item, MusicStore store = OviStore );
+
+signals:
+
+    void tunedToFrequency( uint frequency, int commandSender );
+    void seekingStarted( int direction );
+    void radioStatusChanged( bool radioIsOn );
+
+    void rdsAvailabilityChanged( bool available );
+
+    void volumeChanged( int volume );
+    void muteChanged( bool muted );
+
+    void audioRouteChanged( bool loudspeaker );
+    void antennaStatusChanged( bool connected );
+
+public slots:
+
+    /**
+     * Slots to tune to given frequency or preset
+     */
+    void tuneFrequency( uint frequency, const int reason = TuneReason::Unspecified );
+    void tuneWithDelay( uint frequency, const int reason = TuneReason::Unspecified );
+    void tunePreset( int presetIndex );
+
+    /*!
+     * volume update command slot for the engine
+     */
+    void setVolume( int volume );
+    void toggleMute();
+    void toggleAudioRoute();
+
+    void seekStation( int seekDirection );
+
+    void launchSongRecognition();
+
+private:
+
+    /**
+     * functions used only by the private class to get signals emitted
+     */
+    void emitTunedToFrequency( uint frequency, int commandSender );
+    void emitSeekingStarted( Seeking::Direction direction );
+    void emitRadioStatusChanged( bool radioIsOn );
+    void emitRdsAvailabilityChanged( bool available );
+    void emitVolumeChanged( int volume );
+    void emitMuteChanged( bool muted );
+    void emitAudioRouteChanged( bool loudspeaker );
+    void emitAntennaStatusChanged( bool connected );
+
+private: // data
+
+    /**
+     * Unmodifiable pointer to the private implementation
+     */
+    RadioUiEnginePrivate* const d_ptr;
+
+};
+
+
+#endif // RADIOUIENGINE_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/inc/radiouiengine_p.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,107 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef RADIOUIENGINE_P_H_
+#define RADIOUIENGINE_P_H_
+
+// System includes
+#include <QScopedPointer>
+#include <QPointer>
+
+// User includes
+#include "radio_global.h"
+#include "radioenginewrapperobserver.h"
+
+// Forward declarations
+class RadioUiEngine;
+class RadioEngineWrapper;
+class RadioStationModel;
+class RadioHistoryModel;
+class RadioCarouselModel;
+class RadioPresetStorage;
+class RadioControlService;
+class RadioMonitorService;
+class RadioScannerEngine;
+
+class RadioUiEnginePrivate : public RadioEngineWrapperObserver
+{
+    Q_DECLARE_PUBLIC( RadioUiEngine )
+    Q_DISABLE_COPY( RadioUiEnginePrivate )
+
+public:
+
+    RadioUiEnginePrivate( RadioUiEngine* engine );
+    virtual ~RadioUiEnginePrivate();
+
+    RadioUiEngine& api();
+
+    bool init();
+
+    void cancelSeeking();
+
+    RadioEngineWrapper& wrapper();
+
+private:
+
+// from base class RadioEngineWrapperObserver
+
+    void tunedToFrequency( uint frequency, int reason );
+    void radioStatusChanged( bool radioIsOn );
+    void rdsAvailabilityChanged( bool available );
+    void volumeChanged( int volume );
+    void muteChanged( bool muted );
+    void audioRouteChanged( bool loudspeaker );
+    void antennaStatusChanged( bool connected );
+    void skipPrevious();
+    void skipNext();
+
+// New functions
+
+    /*!
+     * Tunes to next or previous station
+     */
+    uint skip( StationSkip::Mode mode, uint startFrequency = 0 );
+
+private: // data
+
+    /**
+     * Pointer to the public class
+     * Not own.
+     */
+    RadioUiEngine*                          q_ptr;
+
+    QScopedPointer<RadioEngineWrapper>      mEngineWrapper;
+
+    QScopedPointer<RadioPresetStorage>      mPresetStorage;
+
+    QScopedPointer<RadioStationModel>       mStationModel;
+
+    QScopedPointer<RadioHistoryModel>       mHistoryModel;
+
+    QScopedPointer<RadioCarouselModel>      mCarouselModel;
+
+#ifndef BUILD_WIN32
+    QScopedPointer<RadioControlService>     mControlService;
+#endif
+
+    QScopedPointer<RadioMonitorService>     mMonitorService;
+
+    QPointer<RadioScannerEngine>            mScannerEngine;
+
+};
+
+#endif // RADIOUIENGINE_P_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/inc/radiouiengineexport.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef RADIO_UI_ENGINE_EXPORT_H_
+#define RADIO_UI_ENGINE_EXPORT_H_
+
+// System includes
+#include <QtGlobal>
+
+#ifdef BUILD_UI_ENGINE_DLL
+    #define UI_ENGINE_DLL_EXPORT Q_DECL_EXPORT
+#else
+    #define UI_ENGINE_DLL_EXPORT Q_DECL_IMPORT
+#endif
+
+#endif // RADIO_UI_ENGINE_EXPORT_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/radiouiengine.pro	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,101 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+include(../buildflags.pri)
+
+TEMPLATE    = lib
+TARGET      = radiouiengine
+CONFIG      += dll
+DEFINES     += BUILD_UI_ENGINE_DLL
+win32:DESTDIR = ../bin
+
+# Wrapper does not depend on QtGui or Orbit
+QT          = core gui network sql
+CONFIG      -= hb
+CONFIG      += mobility
+MOBILITY    = systeminfo
+
+symbian: {
+    DEFINES += SYMBIAN
+    TARGET.EPOCALLOWDLLDATA = 1
+    TARGET.CAPABILITY = CAP_GENERAL_DLL
+}
+
+INCLUDEPATH += inc
+INCLUDEPATH += ../radiopresetstorage/inc
+INCLUDEPATH += ../radioenginewrapper/inc
+INCLUDEPATH += ../commoninc
+
+win32:LIBS += -L../bin
+
+LIBS += -lradiopresetstorage
+LIBS += -lradioenginewrapper
+
+symbian:LIBS += -lxqservice
+symbian:LIBS += -lxqserviceutil
+symbian:LIBS += -lxqsettingsmanager
+
+DEPENDPATH += $$INCLUDEPATH src
+
+# $$_PRO_FILE_PWD_ points to the directory of the pro file
+MOC_DIR = $$_PRO_FILE_PWD_/tmp
+
+# Input
+HEADERS += radiouiengineexport.h
+HEADERS += radiostation.h
+HEADERS += radiostationmodel.h
+HEADERS += radiostationfiltermodel.h
+HEADERS += radiouiengine.h
+HEADERS += radiohistoryitem.h
+HEADERS += radiohistorymodel.h
+HEADERS += radiocarouselmodel.h
+HEADERS += radioscannerengine.h
+HEADERS += radioservicedef.h
+HEADERS += radionotificationdata.h
+
+symbian:HEADERS += radiocontrolservice.h
+symbian:HEADERS += radiomonitorservice.h
+win32:HEADERS += radiomonitorservice_win32.h
+
+INTERNAL_HEADERS += radiostation_p.h
+INTERNAL_HEADERS += radiohistoryitem_p.h
+INTERNAL_HEADERS += radiohistorymodel_p.h
+INTERNAL_HEADERS += radiocarouselmodel_p.h
+INTERNAL_HEADERS += radiouiengine_p.h
+INTERNAL_HEADERS += radiostationmodel_p.h
+INTERNAL_HEADERS += radioscannerengine_p.h
+
+win32:HEADERS += $$INTERNAL_HEADERS
+
+SOURCES += radiostation.cpp
+SOURCES += radiostation_p.cpp
+SOURCES += radiostationmodel.cpp
+SOURCES += radiostationmodel_p.cpp
+SOURCES += radiostationfiltermodel.cpp
+SOURCES += radiouiengine.cpp
+SOURCES += radiouiengine_p.cpp
+SOURCES += radiohistoryitem.cpp
+SOURCES += radiohistoryitem_p.cpp
+SOURCES += radiohistorymodel.cpp
+SOURCES += radiohistorymodel_p.cpp
+SOURCES += radiocarouselmodel.cpp
+SOURCES += radiocarouselmodel_p.cpp
+SOURCES += radioscannerengine.cpp
+SOURCES += radioscannerengine_p.cpp
+
+symbian:SOURCES += radiocontrolservice.cpp
+symbian:SOURCES += radiomonitorservice.cpp
+win32:SOURCES += radiomonitorservice_win32.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/src/radiocarouselmodel.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,140 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// System includes
+
+// User includes
+#include "radiocarouselmodel.h"
+#include "radiocarouselmodel_p.h"
+#include "radiostationmodel.h"
+#include "radiouiengine.h"
+#include "radiostation.h"
+#include "radio_global.h"
+#include "radiologger.h"
+
+/*!
+ *
+ */
+RadioCarouselModel::RadioCarouselModel( RadioUiEngine& uiEngine, RadioStationModel& stationModel ) :
+    QAbstractListModel( &uiEngine ),
+    d_ptr( new RadioCarouselModelPrivate( this, uiEngine, stationModel ) )
+{
+    connectAndTest( &stationModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
+                    this,          SIGNAL(dataChanged(QModelIndex,QModelIndex)) );
+    connectAndTest( &stationModel, SIGNAL(layoutAboutToBeChanged()),
+                    this,          SIGNAL(layoutAboutToBeChanged()) );
+    connectAndTest( &stationModel, SIGNAL(layoutChanged()),
+                    this,          SIGNAL(layoutChanged()) );
+    connectAndTest( &stationModel, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)),
+                    this,          SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)) );
+    connectAndTest( &stationModel, SIGNAL(rowsInserted(QModelIndex,int,int)),
+                    this,          SIGNAL(rowsInserted(QModelIndex,int,int)) );
+    connectAndTest( &stationModel, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
+                    this,          SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)) );
+    connectAndTest( &stationModel, SIGNAL(rowsRemoved(QModelIndex,int,int)),
+                    this,          SIGNAL(rowsRemoved(QModelIndex,int,int)) );
+    connectAndTest( &stationModel, SIGNAL(modelAboutToBeReset()),
+                    this,          SIGNAL(modelAboutToBeReset()) );
+    connectAndTest( &stationModel, SIGNAL(modelReset()),
+                    this,          SIGNAL(modelReset()) );
+
+//    connectAndTest( model(),        SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
+//                    this,           SLOT(removeFrequency(QModelIndex,int,int)) );
+}
+
+/*!
+ *
+ */
+RadioCarouselModel::~RadioCarouselModel()
+{
+    delete d_ptr;
+}
+
+/*!
+ * \reimp
+ */
+int RadioCarouselModel::rowCount( const QModelIndex& parent ) const
+{
+    Q_UNUSED( parent );
+    Q_D( const RadioCarouselModel );
+    const int rowCount = d->mStationModel.rowCount();
+    if ( rowCount == 0 ) {
+        return 1;
+    }
+    return rowCount;
+}
+
+/*!
+ * \reimp
+ */
+QVariant RadioCarouselModel::data( const QModelIndex& index, int role ) const
+{
+    if ( !index.isValid() ) {
+        return QVariant();
+    }
+
+    Q_D( const RadioCarouselModel );
+    if ( role == RadioStationModel::RadioStationRole ) {
+        const int rowCount = d->mStationModel.rowCount();
+        if ( rowCount == 0 ) {
+            QVariant variant;
+            variant.setValue( d->mStationModel.currentStation() );
+            return variant;
+        } else {
+            return d->mStationModel.data( index, role );
+        }
+    }
+
+    return QVariant();
+}
+
+/*!
+ * Finds the closest station from the given frequency
+ */
+RadioStation RadioCarouselModel::findClosest( const uint frequency, StationSkip::Mode mode )
+{
+    Q_D( RadioCarouselModel );
+    return d->mStationModel.findClosest( frequency, mode );
+}
+
+/*!
+ * Returns the model index corresponding to the given frequency
+ */
+QModelIndex RadioCarouselModel::modelIndexFromFrequency( uint frequency )
+{
+    Q_D( RadioCarouselModel );
+    if ( d->mStationModel.rowCount() == 0 ) {
+        return index( 0, 0 );
+    } else {
+        RadioStation station;
+        if ( d->mStationModel.findFrequency( frequency, station ) ) {
+            return index( d->mStationModel.findPresetIndex( station.presetIndex() ), 0 );
+        }
+    }
+
+    return QModelIndex();
+}
+
+/*!
+ * \reimp
+ */
+void RadioCarouselModel::removeFrequency( const QModelIndex& parent, int first, int last )
+{
+    Q_UNUSED( parent );
+    Q_UNUSED( first );
+    Q_UNUSED( last );
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/src/radiocarouselmodel_p.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// User includes
+#include "radiocarouselmodel_p.h"
+#include "radiostationmodel.h"
+
+/*!
+ *
+ */
+RadioCarouselModelPrivate::RadioCarouselModelPrivate( RadioCarouselModel* model,
+                                                      RadioUiEngine& uiEngine,
+                                                      RadioStationModel& stationModel ) :
+    q_ptr( model ),
+    mUiEngine( uiEngine ),
+    mStationModel( stationModel )
+{
+}
+
+/*!
+ *
+ */
+RadioCarouselModelPrivate::~RadioCarouselModelPrivate()
+{
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/src/radiocontrolservice.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// System includes
+#include <xqserviceutil.h>
+
+// User includes
+#include "radiocontrolservice.h"
+#include "radiouiengine.h"
+#include "radioservicedef.h"
+
+/*!
+ *
+ */
+RadioControlService::RadioControlService( RadioUiEngine& engine ) :
+    XQServiceProvider( RADIO_CONTROL_SERVICE , &engine ),
+    mUiEngine( engine )
+{
+    publishAll();
+    if ( XQServiceUtil::isService() ) {
+        XQServiceUtil::toBackground( true );
+    }
+}
+
+/*!
+ *
+ */
+RadioControlService::~RadioControlService()
+{
+}
+
+/*!
+ * Public slot
+ */
+void RadioControlService::command( int commandId )
+{
+    switch ( commandId )
+    {
+        case RadioServiceCommand::Play:
+            mUiEngine.setMute( false );
+            break;
+
+        case RadioServiceCommand::Pause:
+            mUiEngine.setMute( true );
+            break;
+
+        case RadioServiceCommand::Previous:
+            mUiEngine.skipStation( StationSkip::PreviousFavorite );
+            break;
+
+        case RadioServiceCommand::Next:
+            mUiEngine.skipStation( StationSkip::NextFavorite );
+            break;
+
+        case RadioServiceCommand::SeekUp:
+            mUiEngine.seekStation( Seeking::Up );
+            break;
+
+        case RadioServiceCommand::SeekDown:
+            mUiEngine.seekStation( Seeking::Down );
+            break;
+
+        case RadioServiceCommand::Foreground:
+            XQServiceUtil::toBackground( false );
+            break;
+
+        case RadioServiceCommand::Background:
+            XQServiceUtil::toBackground( true );
+            break;
+
+        default:
+            break;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/src/radiohistoryitem.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,242 @@
+/*
+* 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:
+*
+*/
+
+// User includes
+#include "radiohistoryitem.h"
+#include "radiohistoryitem_p.h"
+
+/**
+ * Static shared data instance that is used by all default-constructed RadioStation instances
+ */
+Q_GLOBAL_STATIC( RadioHistoryItemPrivate, shared_null )
+
+
+/*!
+ *
+ */
+RadioHistoryItem::RadioHistoryItem() :
+    QObject( 0 )
+{
+    mData = shared_null();
+    mData->ref.ref();
+}
+
+/*!
+ *
+ */
+RadioHistoryItem::RadioHistoryItem( const QString& artist, const QString& title ) :
+    QObject( 0 )
+{
+    mData = new RadioHistoryItemPrivate( artist, title );
+}
+
+/*!
+ *
+ */
+RadioHistoryItem::RadioHistoryItem( const RadioHistoryItem& other ) :
+    QObject( 0 )
+{
+    mData = other.mData;
+    mData->ref.ref();
+}
+
+/*!
+ *
+ */
+RadioHistoryItem::~RadioHistoryItem()
+{
+    decrementReferenceCount();
+}
+
+/*!
+ *
+ */
+RadioHistoryItem& RadioHistoryItem::operator=( const RadioHistoryItem& other )
+{
+    qAtomicAssign( mData, other.mData );
+    return *this;
+}
+
+/*!
+ *
+ */
+bool RadioHistoryItem::isValid() const
+{
+    return id() != 0 && !title().isEmpty();
+}
+
+/*!
+ *
+ */
+void RadioHistoryItem::reset()
+{
+    decrementReferenceCount();
+    mData = shared_null();
+    mData->ref.ref();
+}
+
+/*!
+ *
+ */
+int RadioHistoryItem::id() const
+{
+    return mData->mId;
+}
+
+/*!
+ *
+ */
+QString RadioHistoryItem::artist() const
+{
+    return mData->mArtist;
+}
+
+/*!
+ *
+ */
+void RadioHistoryItem::setArtist( const QString& artist )
+{
+    if ( artist.compare( mData->mArtist ) != 0 ) {
+        detach();
+        mData->mArtist = artist;
+    }
+}
+
+/*!
+ *
+ */
+QString RadioHistoryItem::title() const
+{
+    return mData->mTitle;
+}
+
+/*!
+ *
+ */
+void RadioHistoryItem::setTitle( const QString& title )
+{
+    if ( title.compare( mData->mTitle ) != 0 ) {
+        detach();
+        mData->mTitle = title;
+    }
+}
+
+/*!
+ *
+ */
+QString RadioHistoryItem::station() const
+{
+    return mData->mStation;
+}
+
+/*!
+ *
+ */
+void RadioHistoryItem::setStation( const QString& station )
+{
+    if ( station.compare( mData->mStation ) != 0 ) {
+        detach();
+        mData->mStation = station;
+    }
+}
+
+/*!
+ *
+ */
+uint RadioHistoryItem::frequency() const
+{
+    return mData->mFrequency;
+}
+
+/*!
+ *
+ */
+void RadioHistoryItem::setFrequency( uint frequency )
+{
+    if ( frequency != mData->mFrequency ) {
+        detach();
+        mData->mFrequency = frequency;
+    }
+}
+
+/*!
+ *
+ */
+QString RadioHistoryItem::time() const
+{
+    return mData->mTime.toString();
+}
+
+/*!
+ *
+ */
+void RadioHistoryItem::setCurrentTime()
+{
+    detach();
+    mData->mTime.currentDateTime();
+}
+
+
+/*!
+ *
+ */
+bool RadioHistoryItem::isTagged() const
+{
+    return mData->mTagged;
+}
+
+/*!
+ *
+ */
+bool RadioHistoryItem::isRecognizedByRds() const
+{
+    return mData->mFromRds;
+}
+
+/**
+ * Decrements the reference count of the implicitly shared data.
+ */
+void RadioHistoryItem::decrementReferenceCount()
+{
+    if ( !mData->ref.deref() ) {
+        delete mData;
+        mData = 0;
+    }
+}
+
+/**
+ * Detach from the implicitly shared data
+ */
+void RadioHistoryItem::detach()
+{
+    if ( !isDetached() ) {
+        RadioHistoryItemPrivate* newData = new RadioHistoryItemPrivate( *mData );
+
+        decrementReferenceCount();
+
+        newData->ref = 1;
+        mData = newData;
+    }
+}
+
+/**
+ * Checks if the class is detached from implicitly shared data
+ */
+bool RadioHistoryItem::isDetached() const
+{
+    return mData->ref == 1;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/src/radiohistoryitem_p.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,70 @@
+/*
+* 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:
+*
+*/
+
+// System includes
+#include <QSqlRecord>
+#include <QVariant>
+
+// User includes
+#include "radiohistoryitem.h"
+#include "radiohistoryitem_p.h"
+
+/*!
+ *
+ */
+RadioHistoryItemPrivate::RadioHistoryItemPrivate()
+{
+    init( "", "" );
+}
+
+/*!
+ *
+ */
+RadioHistoryItemPrivate::RadioHistoryItemPrivate( const QString& artist,
+                                                  const QString& title )
+{
+    init( artist, title );
+}
+
+/*!
+ *
+ */
+void RadioHistoryItemPrivate::init( const QString& artist, const QString& title )
+{
+    ref = 1;
+    mId = -1;
+    mArtist = artist;
+    mTitle = title;
+    mFrequency = 0;
+    mTagged = false;
+    mFromRds = true;
+}
+
+/*!
+ *
+ */
+void RadioHistoryItemPrivate::initFromRecord( const QSqlRecord& record )
+{
+    mId = record.value( RadioHistoryValue::Id ).toInt();
+    mArtist = record.value( RadioHistoryValue::Artist ).toString();
+    mTitle = record.value( RadioHistoryValue::Title ).toString();
+    mFrequency = record.value( RadioHistoryValue::Frequency ).toUInt() * 1000;
+    mStation = record.value( RadioHistoryValue::Station ).toString();
+    mTagged = record.value( RadioHistoryValue::Tagged ).toBool();
+    mFromRds = record.value( RadioHistoryValue::FromRds ).toBool();
+    mTime = record.value( RadioHistoryValue::Time ).toDateTime();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/src/radiohistorymodel.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,226 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// System includes
+#include <QStringList>
+
+// User includes
+#include "radiohistorymodel.h"
+#include "radiohistorymodel_p.h"
+#include "radiouiengine.h"
+#include "radiohistoryitem.h"
+#include "radiostation.h"
+#include "radiouiengine.h"
+#include "radio_global.h"
+#include "radiologger.h"
+
+/*!
+ *
+ */
+RadioHistoryModel::RadioHistoryModel( RadioUiEngine& uiEngine ) :
+    QAbstractListModel( &uiEngine ),
+    d_ptr( new RadioHistoryModelPrivate( this, uiEngine ) )
+{
+    connectAndTest( &uiEngine,  SIGNAL(tunedToFrequency(uint,int)),
+                    this,       SLOT(resetCurrentSong()) );
+    connectAndTest( &uiEngine,  SIGNAL(seekingStarted(int)),
+                    this,       SLOT(resetCurrentSong()) );
+
+    Q_D( RadioHistoryModel );
+    d->connectToDatabase();
+}
+
+/*!
+ *
+ */
+RadioHistoryModel::~RadioHistoryModel()
+{
+    Q_D( RadioHistoryModel );
+    delete d_ptr;
+}
+
+/*!
+ * \reimp
+ */
+int RadioHistoryModel::rowCount( const QModelIndex& parent ) const
+{
+    Q_UNUSED( parent );
+    Q_D( const RadioHistoryModel );
+    return d->rowCount();
+}
+
+/*!
+ * \reimp
+ */
+QVariant RadioHistoryModel::data( const QModelIndex& index, int role ) const
+{
+    if ( !index.isValid() ) {
+        return QVariant();
+    }
+
+    Q_D( const RadioHistoryModel );
+    return d->data( index.row(), role );
+}
+
+/*!
+ * Public slot
+ */
+void RadioHistoryModel::resetCurrentSong()
+{
+    Q_D( RadioHistoryModel );
+    d->mTopItemIsPlaying = false;
+    emit currentSongReset();
+}
+
+/*!
+ * Public slot
+ */
+void RadioHistoryModel::removeAll()
+{
+    Q_D( RadioHistoryModel );
+    d->removeAll();
+}
+
+/*!
+ * Sets the icons to be used in the list
+ */
+void RadioHistoryModel::setIcons( const QIcon& nonTaggedIcon, const QIcon& taggedIcon )
+{
+    Q_D( RadioHistoryModel );
+    d->mNonTaggedIcon = nonTaggedIcon;
+    d->mTaggedIcon = taggedIcon;
+}
+
+/*!
+ *
+ */
+bool RadioHistoryModel::isCurrentSongRecognized() const
+{
+    Q_D( const RadioHistoryModel );
+    return d->mTopItemIsPlaying;
+}
+
+/*!
+ *
+ */
+void RadioHistoryModel::setShowDetails( bool showDetails )
+{
+    Q_D( RadioHistoryModel );
+    d->mShowDetails = showDetails;
+    reset();
+}
+
+/*!
+ *
+ */
+void RadioHistoryModel::setShowTagged( bool showTagged )
+{
+    Q_D( RadioHistoryModel );
+    d->setViewMode( showTagged ? RadioHistoryModelPrivate::ShowTagged : RadioHistoryModelPrivate::ShowAll );
+}
+
+/*!
+ *
+ */
+void RadioHistoryModel::toggleTagging( const RadioHistoryItem& item, const int row )
+{
+    Q_D( RadioHistoryModel );
+    d->toggleTagging( item, row );
+}
+
+/*!
+ *
+ */
+RadioHistoryItem RadioHistoryModel::itemAtIndex( const QModelIndex& index ) const
+{
+    Q_D( const RadioHistoryModel );
+    return d->itemAtIndex( index );
+}
+
+/*!
+ *
+ */
+void RadioHistoryModel::addItem( const QString& artist, const QString& title, const RadioStation& station )
+{
+    Q_D( RadioHistoryModel );
+    d->addItem( artist, title, station );
+}
+
+/*!
+ *
+ */
+void RadioHistoryModel::clearRadioTextPlus()
+{
+    Q_D( RadioHistoryModel );
+    d->mRtItemHolder = "";
+    resetCurrentSong();
+}
+
+/*!
+ *
+ */
+void RadioHistoryModel::addRadioTextPlus( int rtClass, const QString& rtItem, const RadioStation& station )
+{
+    if ( rtClass == RtPlus::Dummy || rtClass == RtPlus::Artist || rtClass == RtPlus::Title ) {
+        Q_D( RadioHistoryModel );
+        if ( d->mRtItemClass == -1 ) {
+            d->mRtItemClass = rtClass;
+            d->mRtItemHolder = rtItem;
+        } else {
+            // Received: Artist - Title
+            if ( d->mRtItemClass == RtPlus::Artist && rtClass == RtPlus::Title ) {
+                addItem( d->mRtItemHolder, rtItem, station );
+
+            // Received: Title - Artist
+            } else if ( rtClass == RtPlus::Artist && d->mRtItemClass == RtPlus::Title ) {
+                addItem( rtItem, d->mRtItemHolder, station );
+
+            // Received: Dummy - Title
+            } else if ( d->mRtItemClass == RtPlus::Dummy && rtClass == RtPlus::Title ) {
+                addItem( "", rtItem, station );
+
+            // Received: Title - Dummy
+            } else if ( rtClass == RtPlus::Dummy && d->mRtItemClass == RtPlus::Title ) {
+                addItem( "", d->mRtItemHolder, station );
+            }
+
+            d->mRtItemHolder = "";
+            d->mRtItemClass = -1;
+        }
+    }
+}
+
+/*!
+ *
+ */
+void RadioHistoryModel::reportChangedData( int start, int end )
+{
+    if ( end == -1 ) {
+        end = start;
+    }
+    const QModelIndex startIndex = index( start, 0, QModelIndex() );
+    const QModelIndex endIndex = index( end, 0, QModelIndex() );
+    emit dataChanged( startIndex, endIndex );
+}
+
+/*!
+ *
+ */
+void RadioHistoryModel::emitItemAdded()
+{
+    emit itemAdded();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/src/radiohistorymodel_p.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,338 @@
+/*
+* 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:
+*
+*/
+
+// System includes
+#include <QSqlDatabase>
+#include <QFile>
+#include <QDateTime>
+#include <QVariant>
+#include <QStringList>
+#include <QSqlError>
+#include <QSqlQueryModel>
+#include <QSqlRecord>
+
+// User includes
+#include "radiohistorymodel_p.h"
+#include "radiohistorymodel.h"
+#include "radiohistoryitem.h"
+#include "radiohistoryitem_p.h"
+#include "radiostation.h"
+#include "radiologger.h"
+
+const char* DATABASE_NAME       = "radioplayhistory.db";
+const char* DATABASE_DRIVER     = "QSQLITE";
+const char* HISTORY_TABLE       = "history";
+const char* SQL_CREATE_TABLE    = "CREATE TABLE history ("
+                                  "id INTEGER PRIMARY KEY AUTOINCREMENT, "
+                                  "artist TEXT NOT NULL, "
+                                  "title TEXT NOT NULL, "
+                                  "station TEXT NOT NULL, "
+                                  "frequency INTEGER NOT NULL, "
+                                  "tagged INTEGER NOT NULL DEFAULT 0, "
+                                  "fromRds INTEGER NOT NULL DEFAULT 1, "
+                                  "time TIMESTAMP NOT NULL)";
+
+const char* SQL_ADD_ITEM         = "INSERT INTO history (artist,title,station,frequency,fromRds,time) "
+                                            "VALUES ( ?,?,?,?,?,? )";
+
+const char* SQL_SELECT_ALL       = "SELECT * FROM history ORDER BY id DESC";
+const char* SQL_SELECT_TAGGED    = "SELECT * FROM history WHERE tagged=1";// ORDER BY id DESC";
+
+const char* SQL_DELETE_ALL       = "DELETE FROM history";
+
+//static const char* SQL_FIND_ITEM_BY_ID = "SELECT * FROM history WHERE id = ?";
+const char* SQL_TOGGLE_TAG       = "UPDATE history SET tagged = ? WHERE id = ?";
+
+
+#ifdef LOGGING_ENABLED
+#   define GET_ERR( param ) GETSTRING( param.lastError().text() )
+#   define GET_ERR_PTR( param ) GETSTRING( param->lastError().text() )
+#endif // LOGGING_ENABLED
+
+/*!
+ * Static utility function to parse a frequency
+ */
+static  QString parseFrequency( const uint frequency )
+{
+    QString loc = qtTrId( "txt_rad_dblist_val_l1_mhz" );
+    return loc.arg( RadioStation::parseFrequency( frequency ) );
+}
+
+/*!
+ *
+ */
+RadioHistoryModelPrivate::RadioHistoryModelPrivate( RadioHistoryModel* model,
+                                                    RadioUiEngine& uiEngine ) :
+    q_ptr( model ),
+    mUiEngine( uiEngine ),
+    mTopItemIsPlaying( false ),
+    mShowDetails( true ),
+    mViewMode( ShowAll ),
+    mRtItemClass( -1 )
+{
+}
+
+/*!
+ *
+ */
+RadioHistoryModelPrivate::~RadioHistoryModelPrivate()
+{
+    if ( mDatabase && mDatabase->isOpen() ) {
+        mDatabase->close();
+    }
+}
+
+/*!
+ *
+ */
+bool RadioHistoryModelPrivate::connectToDatabase()
+{
+    LOG_METHOD;
+    QSqlDatabase db = QSqlDatabase::addDatabase( DATABASE_DRIVER );
+    if ( db.isValid() ) {
+        mDatabase.reset( new QSqlDatabase( db ) );
+        mDatabase->setDatabaseName( DATABASE_NAME );
+
+        if ( !mDatabase->open() ) {
+            LOG_FORMAT( "Failed to open database! error = %s", GET_ERR_PTR( mDatabase ) );
+            mDatabase.reset();
+            return false;
+        }
+
+        // Create the table if it does not exist
+        if ( !mDatabase->tables().contains( HISTORY_TABLE ) ) {
+            LOG( "RadioHistoryModelPrivate::connectToDatabase: Creating database tables." );
+            QSqlQuery query;
+            if ( !query.exec( SQL_CREATE_TABLE ) ) {
+                LOG_FORMAT( "Database creation failed! error = %s", GET_ERR( query ) );
+                mDatabase->close();
+                mDatabase.reset();
+                return false;
+            }
+        }
+    } else {
+        LOG_FORMAT( "Invalid database! error = %s", GET_ERR( db ) );
+        return false;
+    }
+
+    mQueryModel.reset( new QSqlQueryModel() );
+    setViewMode( ShowAll );
+
+    return mQueryModel->lastError().type() == QSqlError::NoError;
+}
+
+/*!
+ *
+ */
+void RadioHistoryModelPrivate::addItem( const QString& artist,
+                                        const QString& title,
+                                        const RadioStation& station,
+                                        bool fromRds )
+{
+    LOG_FORMAT( "RadioHistoryModelPrivate::addItem. Artist: %s, Title: %s", GETSTRING( artist ), GETSTRING( title ) );
+
+    if ( !mQueryModel ) {
+        return;
+    }
+
+    mTopItemIsPlaying = true;
+
+    QSqlQuery query = beginTransaction();
+
+    query.prepare( SQL_ADD_ITEM );
+    query.addBindValue( artist );
+    query.addBindValue( title );
+    query.addBindValue( station.name() );
+    query.addBindValue( static_cast<int>( station.frequency() / 1000 ) );
+    query.addBindValue( fromRds );
+    query.addBindValue( QDateTime::currentDateTime().toTime_t() );
+
+    commitTransaction( query, InsertRows, 0 );
+}
+
+/*!
+ *
+ */
+int RadioHistoryModelPrivate::rowCount() const
+{
+    if ( !mQueryModel ) {
+        return 0;
+    }
+    return mQueryModel->rowCount();
+}
+
+/*!
+ *
+ */
+QVariant RadioHistoryModelPrivate::data( const int row, const int role ) const
+{
+    if ( mQueryModel->lastError().type() == QSqlError::NoError ) {
+
+        QSqlRecord record = mQueryModel->record( row );
+        if ( role == Qt::DisplayRole ) {
+
+            const QString artist = record.value( RadioHistoryValue::Artist ).toString();
+            const QString title = record.value( RadioHistoryValue::Title ).toString();
+            const QString station = record.value( RadioHistoryValue::Station ).toString();
+            const uint frequency = record.value( RadioHistoryValue::Frequency ).toUInt() * 1000;
+
+            QStringList list;
+            if ( mShowDetails ) {
+                list.append( qtTrId( "txt_rad_dblist_1_2" ).arg( artist ).arg( title ) );
+                QDateTime dateTime = record.value( RadioHistoryValue::Time ).toDateTime();
+                const QString time = dateTime.toLocalTime().toString();
+
+                QString name = !station.isEmpty() ? station : parseFrequency( frequency );
+                list.append( qtTrId( "txt_rad_dblist_1_2" ).arg( time ).arg( name ) );
+            } else {
+                list.append( artist );
+                list.append( title );
+            }
+
+            return list;
+        } else if ( role == Qt::DecorationRole ) {
+            QVariantList list;
+            const bool tagged = record.value( RadioHistoryValue::Tagged ).toBool();
+            if ( tagged ) {
+                list.append( mTaggedIcon );
+            } else {
+                list.append( mNonTaggedIcon );
+            }
+            return list;
+        }
+    }
+
+    return QVariant();
+}
+
+/*!
+ *
+ */
+void RadioHistoryModelPrivate::removeAll()
+{
+    if ( !mQueryModel ) {
+        return;
+    }
+
+    QSqlQuery query = beginTransaction();
+
+    query.prepare( SQL_DELETE_ALL );
+
+    // Commented out because rowsRemoved() seems to crash HbListView
+//    commitTransaction( query, RemoveRows, 0, rowCount() - 1 );
+
+    commitTransaction( query, NoOp, 0 );
+    q_ptr->reset();
+}
+
+/*!
+ *
+ */
+void RadioHistoryModelPrivate::setViewMode( ViewMode mode )
+{
+    if ( !mQueryModel ) {
+        return;
+    }
+
+    mViewMode = mode;
+    mQueryModel->setQuery( mode == ShowTagged ? SQL_SELECT_TAGGED : SQL_SELECT_ALL, *mDatabase );
+    q_ptr->reset();
+}
+
+/*!
+ *
+ */
+void RadioHistoryModelPrivate::toggleTagging( const RadioHistoryItem& item, const int row )
+{
+    QSqlQuery updateQuery = beginTransaction();
+
+    updateQuery.prepare( SQL_TOGGLE_TAG );
+    updateQuery.addBindValue( item.isTagged() ? 0 : 1 );
+    updateQuery.addBindValue( item.id() );
+
+    commitTransaction( updateQuery, ChangeData, row );
+}
+
+/*!
+ *
+ */
+RadioHistoryItem RadioHistoryModelPrivate::itemAtIndex( const QModelIndex& index ) const
+{
+    LOG_METHOD;
+    RadioHistoryItem item;
+    QSqlRecord record = mQueryModel->record( index.row() );
+    item.data_ptr()->initFromRecord( record );
+    return item;
+}
+
+/*!
+ *
+ */
+void RadioHistoryModelPrivate::refreshModel()
+{
+    setViewMode( mViewMode );
+}
+
+/*!
+ *
+ */
+QSqlQuery RadioHistoryModelPrivate::beginTransaction()
+{
+    LOG_METHOD;
+    QSqlQuery newQuery( *mDatabase );
+    mDatabase->transaction();
+    return newQuery;
+}
+
+/*!
+ *
+ */
+void RadioHistoryModelPrivate::commitTransaction( QSqlQuery& query, Operation operation, int start, int end )
+{
+    LOG_METHOD;
+    if ( end == -1 ) {
+        end = start;
+    }
+
+    bool success = false;
+    Q_UNUSED( success );
+    if ( query.exec() ) {
+        if ( operation == InsertRows ) {
+            q_ptr->beginInsertRows( QModelIndex(), start, end );
+        } else if ( operation == RemoveRows ) {
+            q_ptr->beginRemoveRows( QModelIndex(), start, end );
+        }
+
+        success = mDatabase->commit();
+        LOG_ASSERT( success, LOG_FORMAT( "Commit failed! err: %s", GET_ERR_PTR( mDatabase ) ) );
+
+        refreshModel();
+
+        if ( operation == InsertRows ) {
+            q_ptr->endInsertRows();
+            q_ptr->emitItemAdded();
+        } else if ( operation == RemoveRows ) {
+            q_ptr->endRemoveRows();
+        } else if ( operation == ChangeData ) {
+            q_ptr->reportChangedData( start );
+        }
+    } else {
+        LOG_FORMAT( "RadioHistoryModelPrivate::commitTransaction FAILED, rolling back: error = %s", GET_ERR( query ) );
+        success = mDatabase->rollback();
+        LOG_ASSERT( success, LOG_FORMAT( "Rollback failed! err: %s", GET_ERR_PTR( mDatabase ) ) );
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/src/radiomonitorservice.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,269 @@
+/*
+* 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:
+*
+*/
+
+// User includes
+#include "radiomonitorservice.h"
+#include "radiouiengine.h"
+#include "radiouiengine_p.h"
+#include "radiostationmodel.h"
+#include "radioenginewrapper.h"
+#include "radioscannerengine.h"
+#include "radiostation.h"
+#include "radioservicedef.h"
+#include "radionotificationdata.h"
+#include "radiologger.h"
+
+#define RUN_NOTIFY( type, data ) \
+    do { \
+        QVariant variant; \
+        variant.setValue( RadioNotificationData( RadioServiceNotification::type, data ) ); \
+        notify( variant ); \
+    } while ( 0 )
+
+/*!
+ *
+ */
+RadioMonitorService::RadioMonitorService( RadioUiEnginePrivate& engine ) :
+    XQServiceProvider( RADIO_MONITOR_SERVICE, &engine.api() ),
+    mUiEngine( engine ),
+    mRadioStatus( RadioStatus::UnSpecified )
+{
+    publishAll();
+}
+
+/*!
+ *
+ */
+RadioMonitorService::~RadioMonitorService()
+{
+}
+
+/*!
+ *
+ */
+void RadioMonitorService::init()
+{
+    RadioStationModel* stationModel = &mUiEngine.api().stationModel();
+    connectAndTest( stationModel,   SIGNAL(rowsRemoved(QModelIndex,int,int)),
+                    this,           SLOT(notifyFavoriteCount()) );
+    connectAndTest( stationModel,   SIGNAL(favoriteChanged(RadioStation)),
+                    this,           SLOT(notifyFavoriteCount()) );
+    connectAndTest( stationModel,   SIGNAL(stationDataChanged(RadioStation)),
+                    this,           SLOT(notifyStationChange(RadioStation)) );
+    connectAndTest( stationModel,   SIGNAL(radioTextReceived(RadioStation)),
+                    this,           SLOT(notifyStationChange(RadioStation)) );
+
+    RadioUiEngine* uiEngine = &mUiEngine.api();
+    connectAndTest( uiEngine,       SIGNAL(seekingStarted(int)),
+                    this,           SLOT(notifyRadioStatus()) );
+    connectAndTest( uiEngine,       SIGNAL(muteChanged(bool)),
+                    this,           SLOT(notifyRadioStatus()) );
+    connectAndTest( uiEngine,       SIGNAL(antennaStatusChanged(bool)),
+                    this,           SLOT(notifyRadioStatus()) );
+
+    mUiEngine.wrapper().addObserver( this );
+
+    notifyRadioStatus();
+}
+
+/*!
+ *
+ */
+void RadioMonitorService::notifySong( const QString& song )
+{
+    RUN_NOTIFY( Song, song );
+}
+
+/*!
+ * Public slot
+ *
+ */
+void RadioMonitorService::requestNotifications()
+{
+    mRequestIndexes.append( setCurrentRequestAsync() );
+}
+
+/*!
+ * Public slot
+ *
+ */
+void RadioMonitorService::requestAllData()
+{
+    RadioStationModel& stationModel = mUiEngine.api().stationModel();
+    const RadioStation station = stationModel.currentStation();
+
+    QVariantList notificationList;
+    QVariant notification;
+
+    RadioStatus::Status radioStatus = determineRadioStatus();
+    notification.setValue( RadioNotificationData( RadioServiceNotification::RadioStatus, radioStatus ) );
+    notificationList.append( notification );
+
+    notification.setValue( RadioNotificationData( RadioServiceNotification::FavoriteCount, stationModel.favoriteCount() ) );
+    notificationList.append( notification );
+
+    notification.setValue( RadioNotificationData( RadioServiceNotification::Frequency, station.frequency() ) );
+    notificationList.append( notification );
+
+    if ( !station.name().isEmpty() ) {
+        notification.setValue( RadioNotificationData( RadioServiceNotification::Name, station.name() ) );
+        notificationList.append( notification );
+    }
+
+    if ( station.genre() > 0 ) {
+        notification.setValue( RadioNotificationData( RadioServiceNotification::Genre,
+                        mUiEngine.api().genreToString( station.genre(), GenreTarget::HomeScreen ) ) );
+        notificationList.append( notification );
+    }
+
+    if ( !station.radioText().isEmpty() ) {
+        notification.setValue( RadioNotificationData( RadioServiceNotification::RadioText, station.radioText() ) );
+        notificationList.append( notification );
+    }
+
+    if ( !station.url().isEmpty() ) {
+        notification.setValue( RadioNotificationData( RadioServiceNotification::HomePage, station.url() ) );
+        notificationList.append( notification );
+    }
+
+    //TODO: To be implemented
+//    notification.setValue( RadioNotificationData( RadioServiceNotification::Song,  ) );
+//    notificationList.append( notification );
+
+    completeRequest( setCurrentRequestAsync(), notificationList );
+}
+
+/*!
+ * Private slot
+ */
+void RadioMonitorService::notifyRadioStatus()
+{
+    RadioStatus::Status radioStatus = determineRadioStatus();
+
+    if ( radioStatus != mRadioStatus ) {
+        if ( radioStatus == RadioStatus::Seeking ) {
+            connectAndTest( mUiEngine.api().scannerEngine(),    SIGNAL(destroyed()),
+                            this,                               SLOT(notifyRadioStatus()) );
+        }
+
+        mRadioStatus = radioStatus;
+        RUN_NOTIFY( RadioStatus, radioStatus );
+    }
+}
+
+/*!
+ * Private slot
+ *
+ */
+void RadioMonitorService::notifyFavoriteCount()
+{
+    const int favoriteCount = mUiEngine.api().stationModel().favoriteCount();
+    RUN_NOTIFY( FavoriteCount, favoriteCount );
+}
+
+/*!
+ * Private slot
+ *
+ */
+void RadioMonitorService::notifyStationChange( const RadioStation& station )
+{
+    RadioUiEngine& uiEngine = mUiEngine.api();
+    if ( uiEngine.isScanning() ) {
+        return;
+    }
+
+    QVariantList list;
+    QVariant notification;
+
+    if ( station.hasDataChanged( RadioStation::GenreChanged ) ) {
+        const QString genre = uiEngine.genreToString( station.genre(), GenreTarget::HomeScreen );
+        notification.setValue( RadioNotificationData( RadioServiceNotification::Genre, genre ) );
+        list.append( notification );
+    }
+
+    if ( station.hasDataChanged( RadioStation::NameChanged ) ) {
+        notification.setValue( RadioNotificationData( RadioServiceNotification::Name, station.name() ) );
+        list.append( notification );
+    }
+
+    if ( station.hasDataChanged( RadioStation::UrlChanged ) ) {
+        notification.setValue( RadioNotificationData( RadioServiceNotification::HomePage, station.url() ) );
+        list.append( notification );
+    }
+
+    if ( station.hasDataChanged( RadioStation::RadioTextChanged ) ) {
+        notification.setValue( RadioNotificationData( RadioServiceNotification::RadioText, station.radioText() ) );
+        list.append( notification );
+    }
+
+    notifyList( list );
+}
+
+/*!
+ * \reimp
+ */
+void RadioMonitorService::tunedToFrequency( uint frequency, int reason )
+{
+    Q_UNUSED( reason );
+    if ( !mUiEngine.api().isScanning() ) {
+        RUN_NOTIFY( Frequency, frequency );
+        RadioStation station;
+        if ( mUiEngine.api().stationModel().findFrequency( frequency, station ) && !station.name().isEmpty() ) {
+            RUN_NOTIFY( Name, station.name() );
+        }
+    }
+}
+
+/*!
+ *
+ */
+RadioStatus::Status RadioMonitorService::determineRadioStatus() const
+{
+    RadioUiEngine& uiEngine = mUiEngine.api();
+    if ( uiEngine.isScanning() ) {
+        return RadioStatus::Seeking;
+    } else if ( !uiEngine.isAntennaAttached() ) {
+        return RadioStatus::NoAntenna;
+    } else if ( uiEngine.isMuted() ) {
+        return RadioStatus::Muted;
+    }
+
+    return RadioStatus::Playing;
+}
+
+/*!
+ *
+ */
+void RadioMonitorService::notify( const QVariant& notification )
+{
+    QVariantList list;
+    list.append( notification );
+    notifyList( list );
+}
+
+/*!
+ *
+ */
+void RadioMonitorService::notifyList( const QVariantList& list )
+{
+    if ( mRequestIndexes.count() > 0 && list.count() > 0 ) {
+        foreach ( int requestIndex, mRequestIndexes ) {
+            completeRequest( requestIndex, list );
+        }
+        mRequestIndexes.clear();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/src/radiomonitorservice_win32.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,52 @@
+/*
+* 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:
+*
+*/
+
+// User includes
+#include "radiomonitorservice_win32.h"
+#include "radiouiengine_p.h"
+#include "radioservicedef.h"
+
+/*!
+ *
+ */
+RadioMonitorService::RadioMonitorService( RadioUiEnginePrivate& engine ) :
+    QObject(),
+    mUiEngine( engine )
+{
+}
+
+/*!
+ *
+ */
+RadioMonitorService::~RadioMonitorService()
+{
+}
+
+/*!
+ *
+ */
+void RadioMonitorService::init()
+{
+}
+
+/*!
+ *
+ */
+void RadioMonitorService::notifySong( const QString& song )
+{
+    Q_UNUSED( song )
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/src/radioscannerengine.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,138 @@
+/*
+* 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:
+*
+*/
+
+// System includes
+#include <QTimer>
+
+// User includes
+#include "radioscannerengine.h"
+#include "radioscannerengine_p.h"
+#include "radiouiengine.h"
+#include "radiouiengine_p.h"
+#include "radioenginewrapper.h"
+#include "radiostationhandlerif.h"
+#include "radiostationmodel.h"
+#include "radiostation.h"
+
+/*!
+ *
+ */
+RadioScannerEngine::RadioScannerEngine( RadioUiEnginePrivate& uiEngine ) :
+    QObject( &uiEngine.api() ),
+    d_ptr( new RadioScannerEnginePrivate( this, uiEngine ) )
+{
+}
+
+/*!
+ *
+ */
+RadioScannerEngine::~RadioScannerEngine()
+{
+    cancel();
+    delete d_ptr;
+}
+
+/*!
+ * Starts the scanning from minimum frequency
+ */
+void RadioScannerEngine::startScanning()
+{
+    Q_D( RadioScannerEngine );
+    d->mUiEngine.cancelSeeking();
+
+    d->mIsScanning = true;
+
+    if ( !d->mUiEngine.api().isMuted() ) {
+        d->mUiEngine.api().setMute( true );
+        d->mMutedByScanner = true;
+    }
+
+    d->mUiEngine.api().emitSeekingStarted( Seeking::Up );
+
+    d->mUiEngine.api().stationModel().removeAll( RadioStationModel::RemoveLocalStations );
+    d->mLastFoundFrequency = d->mUiEngine.api().minFrequency();
+
+    if ( d->mUiEngine.wrapper().currentFrequency() == d->mLastFoundFrequency ) {
+        // Engine was already at the minimun frequency so start scanning
+        d->mUiEngine.wrapper().startSeeking( Seeking::Up, TuneReason::StationScan );
+    } else {
+        // Engine must be initialized to minimum frequency before scanning can start
+        d->mUiEngine.wrapper().tuneFrequency( d->mLastFoundFrequency, TuneReason::StationScanInitialization );
+    }
+}
+
+/*!
+ * Continues the scanning upwards from current frequency
+ */
+void RadioScannerEngine::continueScanning()
+{
+    Q_D( RadioScannerEngine );
+    d->mUiEngine.wrapper().startSeeking( Seeking::Up, TuneReason::StationScan );
+}
+
+/*!
+ * Checks if the scanning is ongoing
+ */
+bool RadioScannerEngine::isScanning() const
+{
+    Q_D( const RadioScannerEngine );
+    return d->mIsScanning;
+}
+
+/*!
+ * Cancels the scanning process
+ */
+void RadioScannerEngine::cancel()
+{
+    Q_D( RadioScannerEngine );
+    if ( isScanning() ) {
+        d->mIsScanning = false;
+        d->mUiEngine.cancelSeeking();
+    }
+
+    if ( d->mMutedByScanner ) {
+        d->mUiEngine.api().setMute( false );
+        d->mMutedByScanner = false;
+    }
+}
+
+/*!
+ * Adds a new station that was found
+ */
+void RadioScannerEngine::addScannedFrequency( const uint frequency )
+{
+    Q_D( RadioScannerEngine );
+    if ( frequency > d->mLastFoundFrequency ) {
+        // Station has been found normally
+        d->mLastFoundFrequency = frequency;
+        d->addFrequencyAndReport( frequency );
+    } else if ( frequency == d->mUiEngine.api().minFrequency() ) {
+        // Special case. A station has been found in the mininmum frequency
+        d->addFrequencyAndReport( frequency );
+    } else {
+        // Seeking looped around the frequency band. Send invalid station as indicator that the scanning should stop
+        emit stationFound( RadioStation() );
+    }
+}
+
+/*!
+ *
+ */
+void RadioScannerEngine::emitStationFound( const RadioStation& station )
+{
+    emit stationFound( station );
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/src/radioscannerengine_p.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,90 @@
+/*
+* 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:
+*
+*/
+
+// User includes
+#include "radioscannerengine_p.h"
+#include "radioscannerengine.h"
+#include "radiouiengine_p.h"
+#include "radiouiengine.h"
+#include "radiostationhandlerif.h"
+#include "radioenginewrapper.h"
+#include "radiostation.h"
+#include "radiostationmodel.h"
+
+/*!
+ *
+ * @param scanner
+ * @param uiEngine
+ */
+RadioScannerEnginePrivate::RadioScannerEnginePrivate( RadioScannerEngine* scanner, RadioUiEnginePrivate& uiEngine ) :
+    q_ptr( scanner ),
+    mUiEngine( uiEngine ),
+    mLastFoundFrequency( 0 ),
+    mMutedByScanner( false ),
+    mIsScanning( false )
+{
+    mUiEngine.wrapper().addObserver( this );
+}
+
+/*!
+ *
+ */
+RadioScannerEnginePrivate::~RadioScannerEnginePrivate()
+{
+    mUiEngine.wrapper().removeObserver( this );
+}
+
+/*!
+ * \reimp
+ */
+void RadioScannerEnginePrivate::tunedToFrequency( uint frequency, int reason )
+{
+    if ( !mIsScanning ) {
+        return;
+    }
+
+    Q_Q( RadioScannerEngine );
+    if ( reason == TuneReason::StationScanInitialization ) {
+        mUiEngine.wrapper().startSeeking( Seeking::Up, TuneReason::StationScan );
+    } else if ( reason == TuneReason::StationScan ) {
+        if ( frequency > mLastFoundFrequency ) {
+            // Station has been found normally
+            mLastFoundFrequency = frequency;
+            addFrequencyAndReport( frequency );
+        } else if ( frequency == mUiEngine.api().minFrequency() ) {
+            // Special case. A station has been found in the mininmum frequency
+            addFrequencyAndReport( frequency );
+        } else {
+            // Seeking looped around the frequency band. Send invalid station as indicator that the scanning should stop
+            q->emitStationFound( RadioStation() );
+        }
+    }
+}
+
+/*!
+ *
+ */
+void RadioScannerEnginePrivate::addFrequencyAndReport( const uint frequency )
+{
+    RadioStationModel& stationModel = mUiEngine.api().stationModel();
+    stationModel.stationHandlerIf().addScannedFrequency( frequency );
+    RadioStation station;
+    stationModel.findFrequency( frequency, station );
+    Q_Q( RadioScannerEngine );
+    q->emitStationFound( station );
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/src/radiostation.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,697 @@
+/*
+* 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:
+*
+*/
+
+// System includes
+#include <QTime>
+
+// User includes
+#include "radiostation.h"
+#include "radiostation_p.h"
+#include "radiologger.h"
+#include "radio_global.h"
+
+// Constants
+const QString KTagArtist = "artist";
+const QString KTagTitle = "title";
+const QString KLinkArtist = "<a href=\"" + KTagArtist + "\">";
+const QString KLinkTitle = "<a href=\"" + KTagTitle + "\">";
+const QString KLinkClose = "</a>";
+
+const char* callSign[KThreeLetterCallSignCount] =
+   {"KBW", "KCY", "KDB", "KDF", "KEX", "KFH","KFI","KGA","KGB",
+    "KGO", "KGU", "KGW", "KGY", "KHQ", "KID", "KIT", "KJR", "KLO",
+    "KLZ", "KMA", "KMJ", "KNX", "KOA", "KOB", "KOY", "KPQ", "KQV",
+    "KSD", "KSL", "KUJ", "KUT", "KVI", "KWG", "KXL", "KXO", "KYW",
+    "WBT", "WBZ", "WDZ", "WEW", "WGH", "WGL", "WGN", "WGR", "WGY",
+    "WHA", "WHB", "WHK", "WHO", "WHP", "WIL", "WIP", "WIS", "WJR",
+    "WJW", "WJZ", "WKY", "WLS", "WLW", "WMC", "WMT", "WOC", "WOI",
+    "WOL", "WOR", "WOW", "WRC", "WRR", "WSB", "WSM", "WWJ", "WWL"};
+
+const uint piCode[KThreeLetterCallSignCount] =
+   {0x99A5, 0x99A6, 0x9990, 0x99A7, 0x9950, 0x9951, 0x9952, 0x9953,
+    0x9991, 0x9954, 0x9955, 0x9956, 0x9957, 0x99AA, 0x9958, 0x9959,
+    0x995A, 0x995B, 0x995C, 0x995D, 0x995E, 0x995F, 0x9960, 0x99AB,
+    0x9992, 0x9993, 0x9964, 0x9994, 0x9965, 0x9966, 0x9995, 0x9967,
+    0x9968, 0x9996, 0x9997, 0x996B, 0x9999, 0x996D, 0x996E, 0x996F,
+    0x999A, 0x9971, 0x9972, 0x9973, 0x999B, 0x9975, 0x9976, 0x9977,
+    0x9978, 0x999C, 0x999D, 0x997A, 0x99B3, 0x997B, 0x99B4, 0x99B5,
+    0x997C, 0x997D, 0x997E, 0x999E, 0x999F, 0x9981, 0x99A0, 0x9983,
+    0x9984, 0x99A1, 0x99B9, 0x99A2, 0x99A3, 0x99A4, 0x9988, 0x9989};
+
+const uint KDisableLocalAreaCoverageMask = 0x0800;
+
+const int KPsNameChangeThresholdSeconds = 10;
+
+/**
+ * Static shared data instance that is used by all default-constructed RadioStation instances
+ */
+Q_GLOBAL_STATIC_WITH_ARGS( RadioStationPrivate, shared_null, ( RadioStation::SharedNull ) )
+
+/*!
+ *
+ */
+QString RadioStation::parseFrequency( uint frequency )
+{
+    QString freqString;
+    freqString.sprintf( "%.1f", qreal( frequency ) / KFrequencyMultiplier );
+    return freqString;
+}
+
+/*!
+ *
+ */
+RadioStation::RadioStation() :
+    QObject( 0 )
+{
+    mData = shared_null();
+    mData->ref.ref();
+}
+
+/*!
+ *
+ */
+RadioStation::RadioStation( const RadioStation& other ) :
+    QObject( 0 )
+{
+    mData = other.mData;
+    mData->ref.ref();
+}
+
+/*!
+ *
+ */
+RadioStation::RadioStation( int presetIndex, uint frequency ) :
+    QObject( 0 )
+{
+    mData = new RadioStationPrivate( presetIndex, frequency );
+}
+
+/*!
+ *
+ */
+RadioStation::~RadioStation()
+{
+    decrementReferenceCount();
+}
+
+/*!
+ *
+ */
+RadioStation& RadioStation::operator=( const RadioStation& other )
+{
+    qAtomicAssign( mData, other.mData );
+    return *this;
+}
+
+/*!
+ *
+ */
+void RadioStation::reset()
+{
+    decrementReferenceCount();
+    mData = shared_null();
+    mData->ref.ref();
+}
+
+/*!
+ *
+ */
+void RadioStation::setChangeFlags( RadioStation::Change flags )
+{
+    if ( mData->mChangeFlags != flags ) {
+        detach();
+        mData->mChangeFlags = flags;
+    }
+}
+
+/*!
+ *
+ */
+void RadioStation::setPresetIndex( int presetIndex )
+{
+    if ( mData->mPresetIndex != presetIndex ) {
+        detach();
+        mData->mPresetIndex = presetIndex;
+        mData->mChangeFlags |= RadioStation::PersistentDataChanged;
+    }
+}
+
+/*!
+ *
+ */
+void RadioStation::setFrequency( uint frequency )
+{
+    if ( mData->mFrequency != frequency ) {
+        detach();
+        mData->mFrequency = frequency;
+        mData->mChangeFlags |= RadioStation::PersistentDataChanged;
+    }
+}
+
+/*!
+ * Sets the preset name
+ */
+void RadioStation::setName( const QString& name )
+{
+    // Name emptiness is checked because this name setter is used by incoming RDS PS name
+    // and empty names should be ignored
+    if ( !name.isEmpty() && !mData->mRenamedByUser && mData->mName.compare( name ) != 0 ) {
+        detach();
+        mData->mName = name.trimmed();
+        mData->mChangeFlags |= RadioStation::PersistentDataChanged | RadioStation::NameChanged;
+
+        // Save the time when PS name changed and if the last change was too close to the current time
+        // change the PS type to dynamic if it has already been incorrectly determined to be static.
+        QTime previousChange = mData->mLastPsNameChangeTime;
+        mData->mLastPsNameChangeTime = QTime::currentTime();
+        if ( previousChange.isValid() && mData->mPsType == RadioStation::Static &&
+             previousChange.secsTo( mData->mLastPsNameChangeTime ) < KPsNameChangeThresholdSeconds ) {
+            LOG( "Station changed PS name too often. PS type changed to Dynamic" );
+            mData->mPsType = RadioStation::Dynamic;
+            mData->mDynamicPsText = mData->mName;
+            mData->mName = "";
+            mData->mChangeFlags |= RadioStation::PsTypeChanged | RadioStation::DynamicPsChanged;
+            mData->mCallSignCheckDone = false;
+        }
+
+        //TODO: This is a temporary thing to see some URL. Remove this
+        if ( !mData->mName.isEmpty() ) {
+            mData->mUrl = "<a href=\"buu\">www." + mData->mName.toLower() + ".fi</a>";
+        } else {
+            mData->mUrl = "";
+        }
+        mData->mChangeFlags |= RadioStation::UrlChanged;
+    }
+}
+
+/*!
+ *
+ */
+void RadioStation::setGenre( const int genre )
+{
+    if ( mData->mGenre != genre ) {
+        detach();
+        mData->mGenre = genre;
+        mData->mChangeFlags |= RadioStation::PersistentDataChanged | RadioStation::GenreChanged;
+    }
+}
+
+/*!
+ *
+ */
+void RadioStation::setUrl( const QString& url )
+{
+    if ( mData->mUrl.compare( url ) != 0 ) {
+        detach();
+        mData->mUrl = url;
+        mData->mChangeFlags |= RadioStation::PersistentDataChanged | RadioStation::UrlChanged;
+    }
+}
+
+/*!
+ * Sets the PI code
+ * @return true if code was changed, false if not
+ */
+bool RadioStation::setPiCode( int piCode, RadioRegion::Region region )
+{
+    LOG_FORMAT( "RadioStation::setPiCode new PI: %d", piCode );
+    // toggling local area coverage bit code must not be interpreted as new PI code
+    if( region != RadioRegion::America )
+    {
+        piCode &= ~KDisableLocalAreaCoverageMask;
+    }
+
+    LOG_FORMAT( "stored PI: %d", mData->mPiCode );
+    LOG_FORMAT( "call sign check done: %d", mData->mCallSignCheckDone );
+    //prevent executing the below code when unnessesary
+    if ( mData->mPiCode != piCode || !mData->mCallSignCheckDone )
+	{
+        detach();
+        mData->mPiCode = piCode;
+        mData->mChangeFlags |= RadioStation::PersistentDataChanged | RadioStation::PiCodeChanged;
+        // call sign not calculated for clear channel stations
+		//TODO: Remove magic numbers
+        if( ( (mData->mPiCode & 0xF000 ) >> 12 ) == 0x1 )
+        {
+            LOG( "Clear channel station" );
+            mData->mCallSignCheckDone = true;
+        }
+		// if America region, not PS name received and not user renamed station
+        else if ( region == RadioRegion::America && mData->mName.isEmpty() && !isRenamed() )
+        {
+            LOG( "Calculate call sign" );
+            mData->mName = piCodeToCallSign( mData->mPiCode );
+            mData->mChangeFlags |= RadioStation::NameChanged;
+        }
+
+        if ( mData->mChangeFlags.testFlag( RadioStation::PsTypeChanged ) )
+		{
+            LOG( "Call sign check done" );
+            mData->mCallSignCheckDone = true;
+        }
+
+        return true;
+    }
+    return false;
+}
+
+/*!
+ *
+ */
+void RadioStation::setPsType( PsType psType )
+{
+    if ( mData->mPsType != psType ) {
+        detach();
+        mData->mPsType = psType;
+        mData->mChangeFlags |= RadioStation::PsTypeChanged;
+    }
+}
+
+/*!
+ *
+ */
+void RadioStation::setRadioText( const QString& radioText )
+{
+    if ( mData->mRadioText.compare( radioText ) != 0 ) {
+        detach();
+        mData->mRadioText = radioText.isEmpty() ? "" : radioText.trimmed();
+        mData->mChangeFlags |= RadioStation::RadioTextChanged;
+    }
+}
+
+/*!
+ *
+ */
+void RadioStation::setRadioTextPlus( const int rtPlusClass, const QString& rtPlusItem )
+{
+    if ( !mData->mRadioText.isEmpty() &&
+         !rtPlusItem.isEmpty() &&
+         ( rtPlusClass == RtPlus::Artist || rtPlusClass == RtPlus::Title || rtPlusClass == RtPlus::Homepage) )
+    {
+        // Url is saved to its own variable and it is not highlighted from the radiotext
+        if ( rtPlusClass == RtPlus::Homepage ) {
+            setUrl( rtPlusItem );
+            return;
+        }
+
+        detach();
+        QString replacement = "";
+        if ( rtPlusClass == RtPlus::Artist ) {
+            replacement = KLinkArtist;
+        } else if ( rtPlusClass == RtPlus::Title ) {
+            replacement = KLinkTitle;
+        }
+        replacement += rtPlusItem + KLinkClose;
+
+        mData->mRadioText.replace( rtPlusItem, replacement );
+        mData->mChangeFlags |= RadioStation::RadioTextChanged;
+    }
+}
+
+/*!
+ *
+ */
+void RadioStation::setDynamicPsText( const QString& dynamicPsText )
+{
+    if ( mData->mDynamicPsText.compare( dynamicPsText ) != 0 ) {
+        detach();
+        mData->mDynamicPsText = dynamicPsText;
+        mData->mChangeFlags |= RadioStation::DynamicPsChanged;
+    }
+}
+
+/*!
+ *
+ */
+bool RadioStation::isValid() const
+{
+    return mData->mPresetIndex >= 0 && mData->mFrequency > 0;
+}
+
+/*!
+ *
+ */
+QString RadioStation::name() const
+{
+    return mData->mName.isEmpty() ? "" : mData->mName;
+}
+
+/*!
+ *
+ */
+void RadioStation::setUserDefinedName( const QString& name )
+{
+    // We don't check for name emptiness because this setter is used also to remove the renaming
+    // of a station by setting an empty name
+    if ( mData->mName.compare( name ) != 0 ) {
+        detach();
+        mData->mName = name;
+        mData->mRenamedByUser = !name.isEmpty();
+        mData->mChangeFlags |= RadioStation::PersistentDataChanged | RadioStation::NameChanged;
+    }
+}
+
+/*!
+ *
+ */
+bool RadioStation::isRenamed() const
+{
+    return mData->mRenamedByUser;
+}
+
+/*!
+ *
+ */
+int RadioStation::genre() const
+{
+    return mData->mGenre;
+}
+
+/*!
+ *
+ */
+QString RadioStation::frequencyMhz() const
+{
+    return parseFrequency( mData->mFrequency );
+}
+
+/*!
+ *
+ */
+uint RadioStation::frequency() const
+{
+    return mData->mFrequency;
+}
+
+/*!
+ *
+ */
+int RadioStation::presetIndex() const
+{
+    return mData->mPresetIndex;
+}
+
+/*!
+ *
+ */
+void RadioStation::setFavorite( bool favorite )
+{
+    if ( isFavorite() != favorite ) {
+        detach();
+        favorite ? setType( RadioStation::Favorite ) : unsetType( RadioStation::Favorite );
+        mData->mChangeFlags |= RadioStation::PersistentDataChanged | RadioStation::FavoriteChanged;
+    }
+}
+
+/*!
+ *
+ */
+bool RadioStation::isFavorite() const
+{
+    return mData->mType.testFlag( RadioStation::Favorite );
+}
+
+/*!
+ *
+ */
+QString RadioStation::url() const
+{
+    return mData->mUrl;
+}
+
+/*!
+ *
+ */
+bool RadioStation::hasPiCode() const
+{
+    return mData->mPiCode != -1;
+}
+
+/*!
+ *
+ */
+bool RadioStation::hasRds() const
+{
+    return hasPiCode() ||
+            mData->mGenre != -1 ||
+            !mData->mDynamicPsText.isEmpty() ||
+            !mData->mRadioText.isEmpty() ||
+            ( !mData->mName.isEmpty() && !isRenamed() );
+}
+
+/*!
+ *
+ */
+void RadioStation::setType( RadioStation::Type type )
+{
+    if ( !isType( type ) ) {
+        detach();
+
+        // Check if favorite-status changed
+        if ( mData->mType.testFlag( RadioStation::Favorite ) != type.testFlag( RadioStation::Favorite ) ) {
+            mData->mChangeFlags |= RadioStation::FavoriteChanged;
+        }
+
+        mData->mType |= type;
+        mData->mChangeFlags |= RadioStation::PersistentDataChanged | RadioStation::TypeChanged;
+    }
+}
+
+/*!
+ *
+ */
+void RadioStation::unsetType( RadioStation::Type type )
+{
+    if ( isType( type ) ) {
+        detach();
+
+        // Check if favorite-status changed
+        if ( mData->mType.testFlag( RadioStation::Favorite ) != type.testFlag( RadioStation::Favorite ) ) {
+            mData->mChangeFlags |= RadioStation::FavoriteChanged;
+        }
+
+        mData->mType &= ~type;
+        mData->mChangeFlags |= RadioStation::PersistentDataChanged | RadioStation::TypeChanged;
+    }
+}
+
+/*!
+ *
+ */
+bool RadioStation::isType( RadioStation::Type type ) const
+{
+    return ( mData->mType & type ) == type;
+}
+
+/*!
+ *
+ */
+RadioStation::PsType RadioStation::psType() const
+{
+    return mData->mPsType;
+}
+
+/*!
+ *
+ */
+QString RadioStation::radioText() const
+{
+    return mData->mRadioText;
+}
+
+/*!
+ *
+ */
+QString RadioStation::dynamicPsText() const
+{
+    return mData->mDynamicPsText;
+}
+
+/*!
+ *
+ */
+RadioStation::Change RadioStation::changeFlags() const
+{
+    return mData->mChangeFlags;
+}
+
+/*!
+ *
+ */
+bool RadioStation::hasDataChanged( RadioStation::Change flags ) const
+{
+    return ( mData->mChangeFlags & flags ) == flags;
+}
+
+/*!
+ *
+ */
+bool RadioStation::hasChanged() const
+{
+    return mData->mChangeFlags != RadioStation::NoChange;
+}
+
+/*!
+ *
+ */
+void RadioStation::resetChangeFlags()
+{
+    if ( mData->mChangeFlags != RadioStation::NoChange ) {
+        detach();
+        mData->mChangeFlags = RadioStation::NoChange;
+    }
+}
+
+/**
+ * Decrements the reference count of the implicitly shared data.
+ */
+void RadioStation::decrementReferenceCount()
+{
+    if ( !mData->ref.deref() ) {
+        delete mData;
+        mData = 0;
+    }
+}
+
+/*!
+ *
+ */
+ QString RadioStation::piCodeToCallSign( uint programmeIdentification )
+ {
+    QString callSign;
+
+    LOG_FORMAT( "RadioStation::piCodeToCallSign PI: %d", programmeIdentification );
+    // call signs beginning with 'K'
+    if( ( programmeIdentification>=KKxxxCallSignPiFirst ) && ( programmeIdentification < KWxxxCallSignPiFirst ) ) {
+        callSign += "K";
+        callSign += iterateCallSign( KKxxxCallSignPiFirst, programmeIdentification );
+    }
+    // call signs beginning with 'W'
+    else if (( programmeIdentification >= KWxxxCallSignPiFirst ) && ( programmeIdentification <= KWxxxCallSignPiLast )) {
+        callSign += "W";
+        callSign += iterateCallSign( KWxxxCallSignPiFirst, programmeIdentification );
+    }
+    // 3 letter only call signs
+    else if(( programmeIdentification >= KxxxCallSignPiFirst ) && ( programmeIdentification <= KxxxCallSignPiLast)) {
+        callSign += callSignString( programmeIdentification );
+    }
+    else
+    {
+        LOG( "RadioStation::piCodeToCallSign - Unhandled else" );
+    }
+
+    LOG_FORMAT( "RadioStation::piCodeToCallSign, call sign: %s", GETSTRING(callSign) );
+
+    return callSign;
+}
+
+/*!
+ *
+ */
+QString RadioStation::iterateCallSign( int piBase, int programmeIdentification )
+{
+    QString callSign;
+    LOG_FORMAT( "RadioStation::iterateCallSign base: %d", piBase );
+
+    int sum(0), i(0);
+
+    while( sum < programmeIdentification ) {
+        i++;
+        sum = piBase + i * 676 + 0 + 0;
+    }
+    callSign += callSignChar( i - 1 );
+
+    int tmpSum( sum - 676 );
+    sum -= 676;
+    i = 0;
+    while( sum <= programmeIdentification ) {
+        i++;
+        sum = tmpSum + 0 + i * 26 + 0;
+    }
+    callSign += callSignChar( i - 1 );
+
+    tmpSum = sum - 26;
+    sum -= 26;
+    i = 0;
+    while( sum <= programmeIdentification ) {
+        i++;
+        sum = tmpSum + 0 + 0 + i;
+    }
+    callSign += callSignChar( i - 1 );
+
+    return callSign;
+    }
+
+/*!
+ *
+ */
+QString RadioStation::callSignString( uint programmeIdentification )
+{
+    for ( uint i = 0; i < KThreeLetterCallSignCount; ++i ) {
+        if( piCode[i] == programmeIdentification ) {
+            return callSign[i];
+        }
+    }
+
+    LOG_FORMAT( "RadioStation::callSignString, Not found PI: %d", programmeIdentification );
+
+    return QString("????");
+}
+
+/*!
+ *
+ */
+char RadioStation::callSignChar( uint decimalValue )
+{
+    LOG_FORMAT( "RadioStation::callSignChar A+: %d", decimalValue );
+    if ( decimalValue <= KLastCallSignCharCode ) {
+        return static_cast<char>( 'A' + decimalValue );
+    }
+    return '?';
+}
+
+/**
+ * Detach from the implicitly shared data
+ */
+void RadioStation::detach()
+{
+    if ( !isDetached() ) {
+        RadioStationPrivate* newData = new RadioStationPrivate( *mData );
+
+        decrementReferenceCount();
+
+        newData->ref = 1;
+        mData = newData;
+
+        // The shared null instance of the data has its preset index set to -200 (RadioStation::SharedNull).
+        // We change the preset index of the detached data to -100 (RadioStation::Invalid) just to ease
+        // debugging. This guarantees that the only instance that has value -200 is the actual shared null.
+        #ifdef _DEBUG
+        if ( mData->mPresetIndex == RadioStation::SharedNull ) {
+            mData->mPresetIndex = RadioStation::Invalid;
+        }
+        #endif
+    }
+}
+
+/**
+ * Checks if the class is detached from implicitly shared data
+ */
+bool RadioStation::isDetached() const
+{
+    return mData->ref == 1;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/src/radiostation_p.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,213 @@
+/*
+* 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:
+*
+*/
+
+// System includes
+
+// User includes
+#include "radiostation_p.h"
+
+/*!
+ *
+ */
+RadioStationPrivate::RadioStationPrivate( int presetIndex, uint frequency )
+{
+    init( presetIndex, frequency );
+}
+
+/*!
+ *
+ */
+RadioStationPrivate::RadioStationPrivate( RadioStation::PresetFlag flag )
+{
+    init( flag );
+}
+
+/*!
+ *
+ */
+RadioStationPrivate::~RadioStationPrivate()
+{
+}
+
+/*!
+ *
+ */
+void RadioStationPrivate::init( int presetIndex, uint frequency )
+{
+    ref                = 1;
+    mFrequency         = frequency;
+    mPresetIndex       = presetIndex;
+    mRenamedByUser     = false;
+    mGenre             = -1;
+    mPiCode            = -1;
+    mType              = 0;
+    mPsType            = RadioStation::Unknown;
+    mChangeFlags       = RadioStation::NoChange;
+    mCallSignCheckDone = false;
+}
+
+/*!
+ * \reimp
+ */
+int RadioStationPrivate::presetIndex() const
+{
+    return mPresetIndex;
+}
+
+/*!
+ * \reimp
+ */
+void RadioStationPrivate::setPresetIndex( int presetIndex )
+{
+    mPresetIndex = presetIndex;
+}
+
+/*!
+ * \reimp
+ */
+uint RadioStationPrivate::frequency() const
+{
+    return mFrequency;
+}
+
+/*!
+ * \reimp
+ */
+void RadioStationPrivate::setFrequency( uint frequency )
+{
+    mFrequency = frequency;
+}
+
+/*!
+ * \reimp
+ */
+QString RadioStationPrivate::name() const
+{
+    return mName;
+}
+
+/*!
+ * \reimp
+ */
+void RadioStationPrivate::setName( QString name )
+{
+    mName = name;
+}
+
+/*!
+ * \reimp
+ */
+bool RadioStationPrivate::isRenamedByUser() const
+{
+    return mRenamedByUser;
+}
+
+/*!
+ * \reimp
+ */
+void RadioStationPrivate::setRenamedByUser( bool renamed )
+{
+    mRenamedByUser = renamed;
+}
+
+/*!
+ * \reimp
+ */
+int RadioStationPrivate::genre() const
+{
+    return mGenre;
+}
+
+/*!
+ * \reimp
+ */
+void RadioStationPrivate::setGenre( int genre )
+{
+    mGenre = genre;
+}
+
+/*!
+ * \reimp
+ */
+QString RadioStationPrivate::url() const
+{
+    return mUrl;
+}
+
+/*!
+ * \reimp
+ */
+void RadioStationPrivate::setUrl( QString url )
+{
+    mUrl = url;
+}
+
+/*!
+ * \reimp
+ */
+int RadioStationPrivate::piCode() const
+{
+    return mPiCode;
+}
+
+/*!
+ * \reimp
+ */
+void RadioStationPrivate::setPiCode( int piCode )
+{
+    mPiCode = piCode;
+}
+
+/*!
+ * \reimp
+ */
+bool RadioStationPrivate::isFavorite() const
+{
+    return mType.testFlag( RadioStation::Favorite );
+}
+
+/*!
+ * \reimp
+ */
+void RadioStationPrivate::setFavorite( bool favorite )
+{
+    if ( favorite ) {
+        mType |= RadioStation::Favorite;
+    } else {
+        mType &= ~RadioStation::Favorite;
+    }
+}
+
+/*!
+ * \reimp
+ */
+bool RadioStationPrivate::isLocalStation() const
+{
+    return mType.testFlag( RadioStation::LocalStation );
+}
+
+/*!
+ * \reimp
+ */
+void RadioStationPrivate::setLocalStation( bool localStation )
+{
+    if ( localStation ) {
+        mType |= RadioStation::LocalStation;
+    } else {
+        mType &= ~RadioStation::LocalStation;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/src/radiostationfiltermodel.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,179 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "radiostationfiltermodel.h"
+#include "radiouiengine.h"
+#include "radiostationmodel.h"
+#include "radiologger.h"
+
+#include "radiostation.h" // Remove
+
+/*!
+ *
+ */
+RadioStationFilterModel::RadioStationFilterModel( RadioUiEngine& uiEngine, QObject* parent ) :
+    QSortFilterProxyModel( parent ),
+    mUiEngine( uiEngine ),
+    mIsCyclic( false )
+{
+    setSourceModel( &mUiEngine.stationModel() );
+    setDynamicSortFilter( true );
+}
+
+/*!
+ *
+ */
+RadioStationFilterModel::~RadioStationFilterModel()
+{
+}
+
+/*!
+ * \reimp
+ */
+int RadioStationFilterModel::rowCount( const QModelIndex& parent ) const
+{
+    const int count = QSortFilterProxyModel::rowCount( parent );
+    return mIsCyclic ? count * 2 : count;
+}
+
+/*!
+ * \reimp
+ */
+QModelIndex RadioStationFilterModel::index( int row, int column,
+                                            const QModelIndex &parent ) const
+{
+    const int count = QSortFilterProxyModel::rowCount();
+    if ( row < count ) {
+        return QSortFilterProxyModel::index( row, column, parent );
+    } else {
+        foreach ( const QModelIndex& shadowIndex, mShadowIndexes.keys() ) {
+            if ( shadowIndex.row() == row ) {
+                return shadowIndex;
+            }
+        }
+
+        return QModelIndex();
+    }
+}
+
+/*!
+ * \reimp
+ */
+QVariant RadioStationFilterModel::data( const QModelIndex& index, int role ) const
+{
+    QModelIndex dataIndex = index;
+    if ( mShadowIndexes.contains( index ) ) {
+        dataIndex = mShadowIndexes.value( index );
+    }
+
+    if ( !index.isValid() || !dataIndex.isValid() ) {
+        return QVariant();
+    }
+
+    return QSortFilterProxyModel::data( dataIndex, role );
+}
+
+/*!
+ *
+ */
+void RadioStationFilterModel::setTypeFilter( RadioStation::Type filter )
+{
+    mFilter = filter;
+    filterChanged();
+}
+
+/*!
+ * Returns the model index corresponding to the given frequency
+ */
+QModelIndex RadioStationFilterModel::modelIndexFromFrequency( uint frequency )
+{
+    QModelIndex index = static_cast<RadioStationModel*>( sourceModel() )->modelIndexFromFrequency( frequency );
+    return mapFromSource( index );
+}
+
+/*!
+ *
+ */
+void RadioStationFilterModel::setCyclic( bool cyclic )
+{
+    mIsCyclic = cyclic;
+    if ( mIsCyclic ) {
+        const int realCount = QSortFilterProxyModel::rowCount();
+        LOG_FORMAT( "Station count: %d", realCount );
+        for ( int i = 0; i < realCount; ++i ) {
+            QModelIndex realIndex = QSortFilterProxyModel::index( i, 0 );
+            QModelIndex shadowIndex = createIndex( i + realCount, 0, realIndex.internalPointer() );
+            //const uint freq = realIndex.data( RadioStationModel::RadioStationRole ).value<RadioStation>().frequency();
+//            LOG_FORMAT( "Adding shadow index %d for index %d. Freq: %u", shadowIndex.row(), realIndex.row(), freq );
+            mShadowIndexes.insert( shadowIndex, realIndex );
+        }
+    }
+}
+
+/*!
+ *
+ */
+bool RadioStationFilterModel::hasLooped( const QModelIndex& index ) const
+{
+    return mShadowIndexes.contains( index );
+}
+
+/*!
+ *
+ */
+QModelIndex RadioStationFilterModel::realIndex( const QModelIndex& shadowIndex ) const
+{
+    return mShadowIndexes.value( shadowIndex );
+}
+
+/*!
+ *
+ */
+bool RadioStationFilterModel::isEqual( const QModelIndex& first, const QModelIndex& second ) const
+{
+    if ( first == second ) {
+        return true;
+    }
+
+    QModelIndex realFirst = first;
+    if ( mShadowIndexes.contains( first ) ) {
+        realFirst = mShadowIndexes.value( first );
+    }
+
+    QModelIndex realSecond = second;
+    if ( mShadowIndexes.contains( second ) ) {
+        realSecond = mShadowIndexes.value( second );
+    }
+
+    if ( realFirst == realSecond ) {
+        return true;
+    }
+
+    return false;
+}
+
+/*!
+ *
+ */
+bool RadioStationFilterModel::filterAcceptsRow( int sourceRow, const QModelIndex& sourceParent ) const
+{
+    QAbstractItemModel* source = sourceModel();
+    QModelIndex index = source->index( sourceRow, 0, sourceParent );
+    const RadioStation station = source->data( index, RadioStationModel::RadioStationRole ).value<RadioStation>();
+    const bool isType = station.isType( mFilter );
+    return isType;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/src/radiostationmodel.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,726 @@
+/*
+* 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:
+*
+*/
+
+// System includes
+#include <QStringList>
+
+#include "radiostationmodel.h"
+#include "radiostationmodel_p.h"
+#include "radiopresetstorage.h"
+#include "radioenginewrapper.h"
+#include "radiouiengine.h"
+#include "radiouiengine_p.h"
+#include "radiostation.h"
+#include "radiostation_p.h"
+#include "radiologger.h"
+
+/*!
+ *
+ */
+static QString parseLine( const RadioStation& station )
+{
+    QString line = "";
+    const QString parsedFrequency = qtTrId( "txt_rad_dblist_l1_mhz" ).arg( RadioStation::parseFrequency( station.frequency() ) );
+    line.append( parsedFrequency );
+
+    QString name = station.name();
+    if ( !name.isEmpty() )
+    {
+        line.append( " - " );
+        line.append( name.trimmed() );
+    }
+
+    LOG_FORMAT( "RadioStationModel: Returning line %s", GETSTRING(line) );
+    return line;
+}
+
+/*!
+ *
+ */
+RadioStationModel::RadioStationModel( RadioUiEnginePrivate& uiEngine ) :
+    QAbstractListModel( &uiEngine.api() ),
+    d_ptr( new RadioStationModelPrivate( this, uiEngine ) )
+{
+}
+
+/*!
+ *
+ */
+RadioStationModel::~RadioStationModel()
+{
+    delete d_ptr;
+}
+
+/*!
+ *
+ */
+Qt::ItemFlags RadioStationModel::flags ( const QModelIndex& index ) const
+{
+    Qt::ItemFlags flags = QAbstractListModel::flags( index );
+    flags |= Qt::ItemIsEditable;
+    return flags;
+}
+
+/*!
+ *
+ */
+int RadioStationModel::rowCount( const QModelIndex& parent ) const
+{
+    Q_UNUSED( parent );
+    Q_D( const RadioStationModel );
+    const int count = d->mStations.keys().count();
+    return count;
+}
+
+/*!
+ * Checks the given station and emits signals based on what member variables had been changed
+ */
+QVariant RadioStationModel::data( const QModelIndex& index, int role ) const
+{
+    if ( !index.isValid() ) {
+        return QVariant();
+    }
+
+    Q_D( const RadioStationModel );
+    if ( role == Qt::DisplayRole ) {
+        RadioStation station = stationAt( index.row() );
+        QString firstLine = parseLine( station );
+        if ( d->mDetailLevel.testFlag( RadioStationModel::ShowGenre ) ) {
+            QStringList list;
+            list.append( firstLine );
+            QString genre = " "; // Empty space so that the listbox generates the second row
+            if ( station.genre() != -1 ) {
+                genre = d->mUiEngine.api().genreToString( station.genre(), GenreTarget::StationsList );
+            }
+            list.append( genre );
+
+            return list;
+        }
+
+        return firstLine;
+    } else if ( role == RadioStationModel::RadioStationRole ) {
+        QVariant variant;
+        variant.setValue( stationAt( index.row() ) );
+        return variant;
+    } else if ( role == Qt::DecorationRole &&
+                d->mDetailLevel.testFlag( RadioStationModel::ShowIcons ) ) {
+        RadioStation station = stationAt( index.row() );
+        QVariantList list;
+        if ( station.isFavorite() && !d->mFavoriteIcon.isNull() ) {
+            list.append( d->mFavoriteIcon );
+        } else {
+            list.append( QIcon() );
+        }
+        if ( currentStation().frequency() == station.frequency() && !d->mNowPlayingIcon.isNull() ) {
+            list.append( d->mNowPlayingIcon );
+        }
+        return list;
+    }
+
+    return QVariant();
+}
+
+/*!
+ * Checks the given station and emits signals based on what member variables had been changed
+ */
+bool RadioStationModel::setData( const QModelIndex& index, const QVariant& value, int role )
+{
+    Q_UNUSED( index );
+
+    if ( role == RadioStationModel::ToggleFavoriteRole ) {
+        const uint frequency = value.toUInt();
+        RadioStation station;
+        if ( findFrequency( frequency, station ) ) {
+            setFavoriteByPreset( station.presetIndex(), !station.isFavorite() );
+        } else {
+            setFavoriteByFrequency( frequency, true );
+        }
+
+        return true;
+    }
+
+    return false;
+}
+
+/*!
+ * Called by the engine to initialize the list with given amount of presets
+ */
+void RadioStationModel::initialize( RadioPresetStorage* storage, RadioEngineWrapper* wrapper )
+{
+    Q_D( RadioStationModel );
+    d->mPresetStorage = storage;
+    d->mWrapper = wrapper;
+    const int presetCount = d->mPresetStorage->presetCount();
+    int index = d->mPresetStorage->firstPreset();
+    LOG_FORMAT( "RadioStationModelPrivate::initialize: presetCount: %d, firstIndex: %d", presetCount, index );
+
+#ifdef COMPILE_WITH_NEW_PRESET_UTILITY
+    while ( index >= 0 ) {
+#else
+    index = 0;
+    while ( index < presetCount ) {
+#endif // COMPILE_WITH_NEW_PRESET_UTILITY
+
+        RadioStation station;
+        station.detach();
+
+        RadioStationIf* preset = static_cast<RadioStationIf*>( station.data_ptr() );
+        if ( d->mPresetStorage->readPreset( index, *preset ) ) {
+            if ( station.isValid() ) {
+                d->mStations.insert( station.frequency(), station );
+            } else {
+                LOG( "RadioStationModelPrivate::initialize: Invalid station!" );
+            }
+        }
+
+#ifdef COMPILE_WITH_NEW_PRESET_UTILITY
+        index = d->mPresetStorage->nextPreset( index );
+#endif
+    }
+
+    d->setCurrentStation( d->mWrapper->currentFrequency() );
+
+    wrapper->addObserver( d );
+}
+
+/*!
+ * Sets the icons to be used in the lists
+ */
+void RadioStationModel::setIcons( const QIcon& favoriteIcon, const QIcon& nowPlayingIcon )
+{
+    Q_D( RadioStationModel );
+    d->mFavoriteIcon = favoriteIcon;
+    d->mNowPlayingIcon = nowPlayingIcon;
+}
+
+/*!
+ * Returns a reference to the station handler interface
+ */
+RadioStationHandlerIf& RadioStationModel::stationHandlerIf()
+{
+    Q_D( RadioStationModel );
+    return *d;
+}
+
+/*!
+ * Returns a reference to the underlying QList so that it can be easily looped
+ */
+const Stations& RadioStationModel::list() const
+{
+    Q_D( const RadioStationModel );
+    return d->mStations;
+}
+
+/*!
+ * Returns the station at the given index.
+ */
+RadioStation RadioStationModel::stationAt( int index ) const
+{
+    // Get the value from the keys list instead of directly accessing the values list
+    // because QMap may have added a default-constructed value to the values list
+    Q_D( const RadioStationModel );
+    if ( index < d->mStations.keys().count() ) {
+        uint frequency = d->mStations.keys().at( index );
+        return d->mStations.value( frequency );
+    }
+    return RadioStation();
+}
+
+/*!
+ * Finds a station by frequency
+ */
+bool RadioStationModel::findFrequency( uint frequency, RadioStation& station )
+{
+    Q_D( RadioStationModel );
+    if ( d->mStations.contains( frequency ) ) {
+        station = d->mStations.value( frequency );
+        return true;
+    }
+    return false;
+}
+
+/*!
+ * Finds a station by preset index
+ */
+int RadioStationModel::findPresetIndex( int presetIndex )
+{
+    Q_D( RadioStationModel );
+    int index = 0;
+    foreach( const RadioStation& tempStation, d->mStations ) {
+        if ( tempStation.presetIndex() == presetIndex ) {
+            return index;
+        }
+        ++index;
+    }
+
+    return RadioStation::NotFound;
+}
+
+/*!
+ * Finds a station by preset index
+ */
+int RadioStationModel::findPresetIndex( int presetIndex, RadioStation& station )
+{
+    Q_D( RadioStationModel );
+    const int index = findPresetIndex( presetIndex );
+    if ( index != RadioStation::NotFound ) {
+        station = d->mStations.values().at( index );
+    }
+    return index;
+}
+
+/*!
+ * Finds the closest station from the given frequency
+ */
+RadioStation RadioStationModel::findClosest( const uint frequency, StationSkip::Mode mode )
+{
+    Q_D( RadioStationModel );
+    const bool findFavorite = mode == StationSkip::PreviousFavorite || mode == StationSkip::NextFavorite;
+    const bool findNext = mode == StationSkip::Next || mode == StationSkip::NextFavorite;
+    QList<RadioStation> list = findFavorite ? d->favorites() : d->mStations.values();
+
+    // Find the previous and next station from current frequency
+    RadioStation previous;
+    RadioStation next;
+    foreach( const RadioStation& station, list ) {
+        const uint testFreq = station.frequency();
+        if ( testFreq == frequency ) {
+            continue;
+        }
+
+        if ( testFreq > frequency ) {
+            next = station;
+            break;
+        }
+        previous = station;
+    }
+
+    // Check if we need to loop around
+    if ( findNext && !next.isValid() ) {
+        next = list.first();
+    } else if ( !findNext && !previous.isValid() ) {
+        previous = list.last();
+    }
+
+    return findNext ? next : previous;
+}
+
+/*!
+ * Removes a station by frequency
+ */
+void RadioStationModel::removeByFrequency( uint frequency )
+{
+    RadioStation station;
+    if ( findFrequency( frequency, station ) ) {
+        removeStation( station );
+    }
+}
+
+/*!
+ * Removes a station by preset index
+ */
+void RadioStationModel::removeByPresetIndex( int presetIndex )
+{
+    RadioStation station;
+    const int index = findPresetIndex( presetIndex, station );
+    if ( index >= 0 ) {
+        removeStation( station );
+    }
+}
+
+/*!
+ * Removes the given station
+ */
+void RadioStationModel::removeStation( const RadioStation& station )
+{
+    Q_D( RadioStationModel );
+    const uint frequency = station.frequency();
+    if ( d->mStations.contains( frequency ) ) {
+
+        // If we are removing the current station, copy its data to the current station pointer
+        // to keep all of the received RDS data still available. They will be discarded when
+        // the user tunes to another frequency, but they are available if the user decides to add it back.
+        if ( d->mCurrentStation->frequency() == frequency ) {
+            *d->mCurrentStation = station;
+        }
+
+        // Copy the station to a temporary variable that can be used as signal parameter
+        RadioStation tempStation = station;
+
+        const int row = modelIndexFromFrequency( tempStation.frequency() ).row();
+        beginRemoveRows( QModelIndex(), row, row );
+
+        d->mPresetStorage->deletePreset( tempStation.presetIndex() );
+        d->mStations.remove( frequency );
+
+        d->mCurrentStation = NULL;
+        d->setCurrentStation( d->mWrapper->currentFrequency() );
+
+        endRemoveRows();
+    }
+}
+
+/*!
+ * Public slot
+ * Removes all stations
+ */
+void RadioStationModel::removeAll( RemoveMode mode )
+{
+    Q_D( RadioStationModel );
+    if ( d->mStations.count() == 0 ) {
+        return;
+    }
+
+    if ( mode == RemoveAll ) {
+        beginRemoveRows( QModelIndex(), 0, rowCount() - 1 );
+
+        // Preset utility deletes all presets with index -1
+        bool success = d->mPresetStorage->deletePreset( -1 );
+        Q_UNUSED( success );
+        RADIO_ASSERT( success, "FMRadio", "Failed to remove station" );
+
+        d->mStations.clear();
+        d->mCurrentStation = NULL;
+        d->setCurrentStation( d->mWrapper->currentFrequency() );
+
+        endRemoveRows();
+    } else {
+        foreach( const RadioStation& station, d->mStations ) {
+
+            if ( mode == RemoveLocalStations ) {
+                if ( station.isType( RadioStation::LocalStation ) && !station.isFavorite() ) {
+                    removeStation( station );
+                }
+            } else {
+                if ( station.isFavorite() ) {
+                    RadioStation newStation( station );
+                    newStation.setFavorite( false );
+                    saveStation( newStation );
+                }
+            }
+        }
+    }
+
+    reset(); // TODO: Remove. this is a workaround to HbGridView update problem
+}
+
+/*!
+ * Adds a new station to the list
+ */
+void RadioStationModel::addStation( const RadioStation& station )
+{
+    Q_D( RadioStationModel );
+    const int newIndex = findUnusedPresetIndex();
+    LOG_FORMAT( "RadioStationModelPrivate::addStation: Adding station to index %d", newIndex );
+
+    RadioStation newStation = station;
+    newStation.setPresetIndex( newIndex );
+    newStation.unsetType( RadioStation::Temporary );
+
+    // We have to call beginInsertRows() BEFORE the addition is actually done so we must figure out where
+    // the new station will go in the sorted frequency order
+    int row = 0;
+    const int count = rowCount();
+    if ( count > 1 ) {
+        Stations::const_iterator iter = d->mStations.upperBound( newStation.frequency() );
+        if ( d->mStations.contains( iter.key() ) ) {
+            row = d->mStations.keys().indexOf( iter.key() );
+        } else {
+            row = count;
+        }
+    } else if ( count == 1 ) {
+        uint existingFreq = d->mStations.keys().first();
+        if ( station.frequency() > existingFreq ) {
+            row = 1;
+        }
+    }
+
+//    emit layoutAboutToBeChanged();
+    beginInsertRows( QModelIndex(), row, row );
+
+    d->doSaveStation( newStation );
+
+    d->setCurrentStation( d->mWrapper->currentFrequency() );
+
+    endInsertRows();
+
+//    emit layoutChanged();
+}
+
+/*!
+ * Saves the given station. It is expected to already exist in the list
+ */
+void RadioStationModel::saveStation( RadioStation& station )
+{
+    Q_D( RadioStationModel );
+    const bool stationHasChanged = station.hasChanged();
+    RadioStation::Change changeFlags = station.changeFlags();
+    station.resetChangeFlags();
+
+    if ( station.isType( RadioStation::Temporary ) ) {
+
+        emitChangeSignals( station, changeFlags );
+
+    } else if ( station.isValid() && stationHasChanged && d->mStations.contains( station.frequency() )) {
+
+        d->doSaveStation( station, changeFlags.testFlag( RadioStation::PersistentDataChanged ) );
+        d->setCurrentStation( d->mWrapper->currentFrequency() );
+
+        emitChangeSignals( station, changeFlags );
+    }
+}
+
+/*!
+ * Finds number of favorite stations
+ */
+int RadioStationModel::favoriteCount()
+{
+    Q_D( const RadioStationModel );
+    return d->favorites().count();
+}
+
+/*!
+ * Changes the favorite status of a station by its frequency. If the station does
+ * not yet exist, it is added.
+ */
+void RadioStationModel::setFavoriteByFrequency( uint frequency, bool favorite )
+{
+    Q_D( RadioStationModel );
+    if ( d->mWrapper->isFrequencyValid( frequency ) ) {
+        LOG_FORMAT( "RadioStationModelPrivate::setFavoriteByFrequency, frequency: %d", frequency );
+        RadioStation station;
+        if ( findFrequency( frequency, station ) ) { // Update existing preset
+            if ( station.isFavorite() != favorite ) {
+                station.setFavorite( favorite );
+                saveStation( station );
+            }
+        } else if ( favorite ) {                    // Add new preset if setting as favorite
+            RadioStation newStation;
+            if ( d->mCurrentStation->frequency() == frequency ) {
+                newStation = *d->mCurrentStation;
+            } else {
+                LOG( "CurrentStation frequency mismatch!" );
+                newStation.setFrequency( frequency );
+            }
+
+            newStation.setType( RadioStation::LocalStation | RadioStation::Favorite );
+
+            // If PI code has been received, it is a local station
+            if ( newStation.hasPiCode() ) {
+                newStation.setType( RadioStation::LocalStation );
+            }
+
+            // Emit the signals only after adding the preset and reinitializing the current station
+            // because the UI will probably query the current station in its slots that get called.
+            addStation( newStation );
+        }
+    }
+}
+
+/*!
+ * Changes the favorite status of a station by its preset index
+ */
+void RadioStationModel::setFavoriteByPreset( int presetIndex, bool favorite )
+{
+    LOG_FORMAT( "RadioStationModelPrivate::setFavoriteByPreset, presetIndex: %d", presetIndex );
+    RadioStation station;
+    if ( findPresetIndex( presetIndex, station ) != RadioStation::NotFound ) {
+        station.setFavorite( favorite );
+        saveStation( station );
+    }
+}
+
+/*!
+ * Renames a station by its preset index
+ */
+void RadioStationModel::renameStation( int presetIndex, const QString& name )
+{
+    LOG_FORMAT( "RadioStationModelPrivate::renameStation, presetIndex: %d, name: %s", presetIndex, GETSTRING(name) );
+    RadioStation station;
+    if ( findPresetIndex( presetIndex, station ) != RadioStation::NotFound ) {
+        station.setUserDefinedName( name );
+        saveStation( station );
+    }
+}
+
+/*!
+ *
+ */
+void RadioStationModel::setFavorites( const QModelIndexList& favorites )
+{
+    foreach ( const QModelIndex& index, favorites ) {
+        RadioStation station = stationAt( index.row() );
+        RADIO_ASSERT( station.isValid() , "RadioStationModel::setFavorites", "invalid RadioStation");
+        setFavoriteByPreset( station.presetIndex(), true );
+    }
+}
+
+/*!
+ * Returns the currently tuned station
+ */
+RadioStation& RadioStationModel::currentStation()
+{
+    Q_D( RadioStationModel );
+    return *d->mCurrentStation;
+}
+
+/*!
+ * Returns the currently tuned station
+ */
+const RadioStation& RadioStationModel::currentStation() const
+{
+    Q_D( const RadioStationModel );
+    return *d->mCurrentStation;
+}
+
+/*!
+ * Sets the model detail level
+ */
+void RadioStationModel::setDetail( Detail level )
+{
+    Q_D( RadioStationModel );
+    d->mDetailLevel = level;
+}
+
+/*!
+ * Returns a list of radio stations in the given frequency range
+ */
+QList<RadioStation> RadioStationModel::stationsInRange( uint minFrequency, uint maxFrequency )
+{
+    Q_D( RadioStationModel );
+    QList<RadioStation> stations;
+    foreach( const RadioStation& station, d->mStations ) {
+        if ( station.frequency() >= minFrequency && station.frequency() <= maxFrequency ) {
+            stations.append( station );
+        }
+    }
+
+    return stations;
+}
+
+/*!
+ * Returns the model index corresponding to the given frequency
+ */
+QModelIndex RadioStationModel::modelIndexFromFrequency( uint frequency )
+{
+    RadioStation station;
+    if ( findFrequency( frequency, station ) ) {
+        return index( findPresetIndex( station.presetIndex() ), 0 );
+    }
+    return QModelIndex();
+}
+
+/*!
+ * Private slot
+ * Timer timeout slot to indicate that the dynamic PS check has ended
+ */
+void RadioStationModel::dynamicPsCheckEnded()
+{
+    Q_D( RadioStationModel );
+    LOG_TIMESTAMP( "Finished dynamic PS check." );
+    if ( d->mCurrentStation->psType() != RadioStation::Dynamic && !d->mCurrentStation->dynamicPsText().isEmpty() )
+    {
+        d->mCurrentStation->setPsType( RadioStation::Static );
+        d->mCurrentStation->setName( d->mCurrentStation->dynamicPsText() );
+        d->mCurrentStation->setDynamicPsText( "" );
+        saveStation( *d->mCurrentStation );
+    }
+}
+
+/*!
+ * Checks the given station and emits signals based on what member variables had been changed
+ */
+void RadioStationModel::emitChangeSignals( const RadioStation& station, RadioStation::Change flags )
+{
+    if ( flags.testFlag( RadioStation::NameChanged ) ||
+         flags.testFlag( RadioStation::GenreChanged ) ||
+         flags.testFlag( RadioStation::UrlChanged ) ||
+         flags.testFlag( RadioStation::TypeChanged ) ||
+         flags.testFlag( RadioStation::PiCodeChanged ) ) {
+
+        // Create a temporary RadioStation for the duration of the signal-slot processing
+        // The receivers can ask the station what data has changed and update accordingly
+        RadioStation tempStation( station );
+        tempStation.setChangeFlags( flags );
+        emit stationDataChanged( tempStation );
+
+        emitDataChanged( tempStation );
+    }
+
+    if ( flags.testFlag( RadioStation::RadioTextChanged ) ) {
+        emit radioTextReceived( station );
+        emitDataChanged( station );
+    }
+
+    if ( flags.testFlag( RadioStation::DynamicPsChanged ) ) {
+        emit dynamicPsChanged( station );
+        emitDataChanged( station );
+    }
+
+    if ( flags.testFlag( RadioStation::FavoriteChanged ) && station.isValid() ) {
+        emit favoriteChanged( station );
+        emitDataChanged( station );
+    }
+}
+
+/*!
+ *
+ */
+void RadioStationModel::emitDataChanged( const RadioStation& station )
+{
+    const int row = findPresetIndex( station.presetIndex() );
+    QModelIndex top = index( row, 0, QModelIndex() );
+    QModelIndex bottom = index( row, 0, QModelIndex() );
+    emit dataChanged( top, bottom );
+}
+
+/*!
+ * Finds an unused preset index
+ */
+int RadioStationModel::findUnusedPresetIndex()
+{
+    Q_D( RadioStationModel );
+    QList<int> indexes;
+    foreach( const RadioStation& station, d->mStations ) {
+        if ( station.isValid() ) {
+            indexes.append( station.presetIndex() );
+        }
+    }
+
+    int index = 0;
+    for ( ; indexes.contains( index ); ++index ) {
+        // Nothing to do here
+    }
+
+    LOG_FORMAT( "RadioStationModelPrivate::findUnusedPresetIndex, index: %d", index );
+    return index;
+}
+
+/*!
+ * Used by the RDS data setters to find the correct station where the data is set
+ */
+RadioStation RadioStationModel::findCurrentStation( uint frequency )
+{
+    Q_D( RadioStationModel );
+    RadioStation station = *d->mCurrentStation;
+    if ( station.frequency() != frequency ) {
+        if ( !findFrequency( frequency, station ) ) {
+            return RadioStation();
+        }
+    }
+    return station;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/src/radiostationmodel_p.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,328 @@
+/*
+* 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:
+*
+*/
+
+// System includes
+#include <QTimer>
+
+// User includes
+#include "radiostationmodel.h"
+#include "radiostationmodel_p.h"
+#include "radiologger.h"
+#include "radiopresetstorage.h"
+#include "radioenginewrapper.h"
+#include "radiouiengine.h"
+#include "radiouiengine_p.h"
+#include "radiostation.h"
+#include "radiostation_p.h"
+#include "radiohistorymodel.h"
+
+// Constants
+/**
+ * Timeout period for checking if station is sending dynamic PS in milliseconds
+ */
+const int KDynamicPsCheckTimeout = 10 * 1000;
+
+/*!
+ *
+ */
+RadioStationModelPrivate::RadioStationModelPrivate( RadioStationModel* model,
+                                                    RadioUiEnginePrivate& uiEngine ) :
+    q_ptr( model ),
+    mUiEngine( uiEngine ),
+    mCurrentStation( &mManualStation ),
+    mDynamicPsTimer( new QTimer() )
+{
+    connectAndTest( mDynamicPsTimer.data(), SIGNAL(timeout()),
+                    q_ptr,                  SLOT(dynamicPsCheckEnded()) );
+    mDynamicPsTimer->setInterval( KDynamicPsCheckTimeout );
+    mDynamicPsTimer->setSingleShot( true );
+}
+
+/*!
+ *
+ */
+RadioStationModelPrivate::~RadioStationModelPrivate()
+{
+    // Destructor needs to be defined. See explanation from RadioEngineWrapperPrivate destructor.
+}
+
+/*!
+ * \reimp
+ */
+uint RadioStationModelPrivate::currentFrequency() const
+{
+    return mCurrentStation->frequency();
+}
+
+/*!
+ * \reimp
+ */
+int RadioStationModelPrivate::currentPresetIndex() const
+{
+    return mCurrentStation->presetIndex();
+}
+
+/*!
+ * Sets the currently tuned frequency. Meant to be set by the engine wrapper
+ */
+void RadioStationModelPrivate::setCurrentStation( uint frequency )
+{
+    LOG_METHOD;
+    RadioStation* oldStation = mCurrentStation;
+    if ( mStations.contains( frequency ) ) {
+        // We have to be careful to check that key exists before using operator[]
+        // with QMap since it will insert a default-constructed value if it doesn't exist yet.
+        mCurrentStation = &mStations[ frequency ];
+    } else {
+        mManualStation.reset();
+        mManualStation.setFrequency( frequency );
+        mCurrentStation = &mManualStation;
+    }
+
+    Q_Q( RadioStationModel );
+    if ( oldStation && oldStation->isValid() ) {
+        q->emitDataChanged( *oldStation );
+    }
+}
+
+/*!
+ * \reimp
+ * Sets the genre to the currently tuned station
+ */
+void RadioStationModelPrivate::setCurrentGenre( uint frequency, int genre )
+{
+    Q_Q( RadioStationModel );
+    RadioStation station = q->findCurrentStation( frequency );
+    if ( !station.isValid() ) {
+        LOG( "Unable to find current station. Ignoring RDS" );
+        return;
+    }
+    station.setGenre( genre );
+    q->saveStation( station );
+}
+
+/*!
+ * \reimp
+ *
+ */
+void RadioStationModelPrivate::tunedToFrequency( uint frequency, int reason )
+{
+    if ( reason == TuneReason::Seek ) {
+        addScannedFrequency( frequency );
+    }
+
+    setCurrentStation( frequency );
+    startDynamicPsCheck();
+}
+
+/*!
+ * \reimp
+ * Checks if the given frequency exists in the list
+ */
+bool RadioStationModelPrivate::containsFrequency( uint frequency )
+{
+    return mStations.contains( frequency );
+}
+
+/*!
+ * \reimp
+ * Checks if the given preset index exists in the list
+ */
+bool RadioStationModelPrivate::containsPresetIndex( int presetIndex )
+{
+    Q_Q( RadioStationModel );
+    return q->findPresetIndex( presetIndex ) != RadioStation::NotFound;
+}
+
+/*!
+ * \reimp
+ * Starts the dynamic PS check
+ */
+void RadioStationModelPrivate::startDynamicPsCheck()
+{
+    // Start the Dynamic PS check if the station has no name and ps type is not known
+    // During the dynamic PS check the RadioStation's dynamicPs variable is used to store the
+    // received PS name even though at this point it isn't known if it is dynamic or not.
+    mDynamicPsTimer->stop();
+    if ( mCurrentStation->psType() == RadioStation::Unknown ) {
+        mCurrentStation->setDynamicPsText( "" );
+        mDynamicPsTimer->start();
+    }
+}
+
+/*!
+ * \reimp
+ *
+ */
+void RadioStationModelPrivate::addScannedFrequency( uint frequency )
+{
+    Q_Q( RadioStationModel );
+    RadioStation station;
+    if ( q->findFrequency( frequency, station ) ) {
+        station.setType( RadioStation::LocalStation );
+        q->saveStation( station );
+    } else {
+        station.setType( RadioStation::LocalStation );
+        station.setFrequency( frequency );
+        q->addStation( station );
+    }
+}
+
+/*!
+ * \reimp
+ * Sets the PS name to the currently tuned station
+ */
+void RadioStationModelPrivate::setCurrentPsName( uint frequency, const QString& name )
+{
+    Q_Q( RadioStationModel );
+    LOG_FORMAT( "void RadioStationModelPrivate::setCurrentPsName: %s", GETSTRING( name ) );
+    RadioStation station = q->findCurrentStation( frequency );
+    if ( !station.isValid() ) {
+        LOG( "Unable to find current station. Ignoring RDS" );
+        return;
+    }
+
+    if ( station.psType() == RadioStation::Static ) {
+
+        if ( name.compare( station.name() ) != 0 && !station.isRenamed() ) {
+            station.setName( name );
+            q->saveStation( station );
+        }
+
+    } else {
+
+        if ( mDynamicPsTimer->isActive() ) {    // Dynamic PS check is ongoing
+            LOG( "Dynamic Ps check ongoing" );
+
+            if ( !station.dynamicPsText().isEmpty() &&
+                    name.compare( station.dynamicPsText(), Qt::CaseInsensitive ) != 0  ) {
+                LOG( "Dynamic Ps check - Second PS name arrived and is different. PS is dynamic" );
+                station.setPsType( RadioStation::Dynamic ); // Station is sending Dynamic PS
+                mDynamicPsTimer->stop();
+
+                // Cleanup the station name if region is not America
+                if ( !station.name().isEmpty()
+                     && !station.isRenamed()
+                     && mWrapper->region() != RadioRegion::America )
+                {
+                    LOG( "Station name cleanup" );
+                    station.setName( "" );
+                }
+            }
+
+            // Received PS name is published to the UI as dynamic PS while the check is ongoing
+            // even though at this stage we don't know if it is dynamic or not.
+
+            station.setDynamicPsText( name );
+            q->saveStation( station );
+
+        } else {
+
+            if ( station.psType() == RadioStation::Dynamic ) {
+                LOG( "Station uses Dynamic Ps" );
+            } else {
+                LOG( "Station PS type unknown" );
+            }
+
+            station.setDynamicPsText( name );
+            q->saveStation( station );
+        }
+    }
+}
+
+/*!
+ * \reimp
+ * Sets the radio text to the currently tuned station
+ */
+void RadioStationModelPrivate::setCurrentRadioText( uint frequency, const QString& radioText )
+{
+    Q_Q( RadioStationModel );
+    RadioStation station = q->findCurrentStation( frequency );
+    if ( !station.isValid() ) {
+        LOG( "Unable to find current station. Ignoring RDS" );
+        return;
+    }
+    station.setRadioText( radioText );
+    q->saveStation( station );
+    mUiEngine.api().historyModel().clearRadioTextPlus();
+}
+
+/*!
+ * \reimp
+ * Sets the radio text plus to the currently tuned station
+ */
+void RadioStationModelPrivate::setCurrentRadioTextPlus( uint frequency, int rtClass, const QString& rtItem )
+{
+    Q_Q( RadioStationModel );
+    RadioStation station = q->findCurrentStation( frequency );
+    if ( !station.isValid() ) {
+        LOG( "Unable to find current station. Ignoring RDS" );
+        return;
+    }
+    station.setRadioTextPlus( rtClass, rtItem );
+    q->saveStation( station );
+    mUiEngine.api().historyModel().addRadioTextPlus( rtClass, rtItem, station );
+}
+
+/*!
+ * \reimp
+ * Sets the PI code to the currently tuned station
+ */
+void RadioStationModelPrivate::setCurrentPiCode( uint frequency, int piCode )
+{
+    Q_Q( RadioStationModel );
+    RadioStation station = q->findCurrentStation( frequency );
+    if ( !station.isValid() ) {
+        LOG( "Unable to find current station. Ignoring RDS" );
+        return;
+    }
+#ifdef SHOW_CALLSIGN_IN_ANY_REGION
+    RadioRegion::Region region = RadioRegion::America;
+#else
+    RadioRegion::Region region =  mWrapper->region();
+#endif
+
+    station.setPiCode( piCode, region );
+    q->saveStation( station );
+}
+
+/*!
+ *
+ */
+void RadioStationModelPrivate::doSaveStation( RadioStation& station, bool persistentSave )
+{
+    mStations.insert( station.frequency(), station );
+
+    if ( persistentSave ) {
+        const bool success = mPresetStorage->savePreset( *station.data_ptr() );
+        RADIO_ASSERT( success, "RadioStationModelPrivate::saveStation", "Failed to add station" );
+    }
+}
+
+/*!
+ *
+ */
+QList<RadioStation> RadioStationModelPrivate::favorites() const
+{
+    QList<RadioStation> favoriteList;
+    foreach( const RadioStation& tempStation, mStations ) {
+        if ( tempStation.isFavorite() ) {
+            favoriteList.append( tempStation );
+        }
+    }
+    return favoriteList;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/src/radiouiengine.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,646 @@
+/*
+* 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:
+*
+*/
+
+// System includes
+#include <QScopedPointer>
+#include <QProcess>
+#include <QFile>
+
+#ifdef BUILD_WIN32
+#   include <QSettings>
+#else
+#   include <qsysteminfo.h>
+#   include <XQSettingsManager>
+using namespace QtMobility;
+#endif // WIN32_BUILD
+
+// User includes
+#include "radiouiengine.h"
+#include "radiouiengine_p.h"
+#include "radiologger.h"
+#include "radioenginewrapper.h"
+#include "radiostationmodel.h"
+#include "radiohistorymodel.h"
+#include "radiocarouselmodel.h"
+#include "radiohistoryitem.h"
+#include "radiosettings.h"
+#include "radiostationfiltermodel.h"
+#include "radioscannerengine.h"
+
+// Constants
+const QString KPathFormatter = "%1:%2%3";
+const QString KApplicationDir = "\\sys\\bin\\";
+const QString KSongRecognitionApp = "Shazam_0x200265B3.exe";
+const QString KSongRecognitionAppParams = "-listen";
+
+const uint DEFAULT_MIN_FREQUENCY = 87500000;
+const uint RADIO_CENREP_UID = 0x101FF976;
+const uint RADIO_CENREP_FREQUENCY_KEY = 0x00000107;
+
+struct GenreStruct
+{
+    int mGenreCode;
+    const char* mInCarousel;
+    const char* mInStationsList;
+    const char* mInHomeScreen;
+};
+
+const GenreStruct EuropeanGenres[] =
+{
+     { GenreEurope::RdsNone, "", "", "" }
+    ,{ GenreEurope::RdsNews, "txt_rad_info_news", "txt_rad_dblist_l1_mhz_val_news", "txt_rad_info_news_hs" }
+    ,{ GenreEurope::RdsCurrentAffairs, "txt_rad_info_current_affairs", "txt_rad_dblist_l1_mhz_val_current_affairs", "txt_rad_info_current_affairs_hs" }
+    ,{ GenreEurope::RdsInformation, "txt_rad_info_information", "txt_rad_dblist_l1_mhz_val_information", "txt_rad_info_information_hs" }
+    ,{ GenreEurope::RdsSport, "txt_rad_info_sport", "txt_rad_dblist_l1_mhz_val_sport", "txt_rad_info_sport_hs" }
+    ,{ GenreEurope::RdsEducation, "txt_rad_info_education", "txt_rad_dblist_l1_mhz_val_education", "txt_rad_info_education_hs" }
+    ,{ GenreEurope::RdsDrama, "txt_rad_info_drama", "txt_rad_dblist_l1_mhz_val_drama", "txt_rad_info_drama_hs" }
+    ,{ GenreEurope::RdsCulture, "txt_rad_info_culture", "txt_rad_dblist_l1_mhz_val_culture", "txt_rad_info_culture_hs" }
+    ,{ GenreEurope::RdsScience, "txt_rad_info_science", "txt_rad_dblist_l1_mhz_val_science", "txt_rad_info_science_hs" }
+    ,{ GenreEurope::RdsVariedSpeech, "txt_rad_info_varied", "txt_rad_dblist_l1_mhz_val_varied", "txt_rad_info_varied_hs" }
+    ,{ GenreEurope::RdsPopMusic, "txt_rad_info_pop_music", "txt_rad_dblist_l1_mhz_val_pop_music", "txt_rad_info_pop_music_hs" }
+    ,{ GenreEurope::RdsRockMusic, "txt_rad_info_rock_music", "txt_rad_dblist_l1_mhz_val_rock_music", "txt_rad_info_rock_music_hs" }
+    ,{ GenreEurope::RdsEasyListening, "txt_rad_info_easy_listening", "txt_rad_dblist_l1_mhz_val_easy_listening", "txt_rad_info_easy_listening_hs" }
+    ,{ GenreEurope::RdsLightClassical, "txt_rad_info_light_classical", "txt_rad_dblist_l1_mhz_val_light_classical", "txt_rad_info_light_classical_hs" }
+    ,{ GenreEurope::RdsSeriousClassical, "txt_rad_info_serious_classical", "txt_rad_dblist_l1_mhz_val_serious_classical", "txt_rad_info_serious_classical_hs" }
+    ,{ GenreEurope::RdsOtherMusic, "txt_rad_info_other_music", "txt_rad_dblist_l1_mhz_val_other_music", "txt_rad_info_other_music_hs" }
+    ,{ GenreEurope::RdsWeather, "txt_rad_info_weather", "txt_rad_dblist_l1_mhz_val_weather", "txt_rad_info_weather_hs" }
+    ,{ GenreEurope::RdsFinance, "txt_rad_info_finance", "txt_rad_dblist_l1_mhz_val_finance", "txt_rad_info_finance_hs" }
+    ,{ GenreEurope::RdsChildrensProgrammes, "txt_rad_info_childrens_programmes", "txt_rad_dblist_l1_mhz_val_childrens_programmes", "txt_rad_info_childrens_programmes_hs" }
+    ,{ GenreEurope::RdsSocialAffairs, "txt_rad_info_social_affairs", "txt_rad_dblist_l1_mhz_val_social_affairs", "txt_rad_info_social_affairs_hs" }
+    ,{ GenreEurope::RdsReligion, "txt_rad_info_religion", "txt_rad_dblist_l1_mhz_val_religion", "txt_rad_info_religion_hs" }
+    ,{ GenreEurope::RdsPhoneIn, "txt_rad_info_phone_in", "txt_rad_dblist_l1_mhz_val_phone_in", "txt_rad_info_phone_in_hs" }
+    ,{ GenreEurope::RdsTravel, "txt_rad_info_travel", "txt_rad_dblist_l1_mhz_val_travel", "txt_rad_info_travel_hs" }
+    ,{ GenreEurope::RdsLeisure, "txt_rad_info_leisure", "txt_rad_dblist_l1_mhz_val_leisure", "txt_rad_info_leisure_hs" }
+    ,{ GenreEurope::RdsJazzMusic, "txt_rad_info_jazz_music", "txt_rad_dblist_l1_mhz_val_jazz_music", "txt_rad_info_jazz_music_hs" }
+    ,{ GenreEurope::RdsCountryMusic, "txt_rad_info_country_music", "txt_rad_dblist_l1_mhz_val_country_music", "txt_rad_info_country_music_hs" }
+    ,{ GenreEurope::RdsNationalMusic, "txt_rad_info_national_music", "txt_rad_dblist_l1_mhz_val_national_music", "txt_rad_info_national_music_hs" }
+    ,{ GenreEurope::RdsOldiesMusic, "txt_rad_info_oldies_music", "txt_rad_dblist_l1_mhz_val_oldies_music", "txt_rad_info_oldies_music_hs" }
+    ,{ GenreEurope::RdsFolkMusic, "txt_rad_info_folk_music", "txt_rad_dblist_l1_mhz_val_folk_music", "txt_rad_info_folk_music_hs" }
+    ,{ GenreEurope::RdsDocumentary, "txt_rad_info_documentary", "txt_rad_dblist_l1_mhz_val_documentary", "txt_rad_info_documentary_hs" }
+    ,{ GenreEurope::RdsAlarmTest, "txt_rad_info_alarm_test", "txt_rad_dblist_l1_mhz_val_alarm_test", "txt_rad_info_alarm_test_hs" }
+    ,{ GenreEurope::RdsAlarm, "txt_rad_info_alarm", "txt_rad_dblist_l1_mhz_val_alarm", "txt_rad_info_alarm_hs" }
+};
+const int EuropeanGenresCount = sizeof( EuropeanGenres ) / sizeof ( EuropeanGenres[0] );
+
+const GenreStruct AmericanGenres[] =
+{
+     { GenreAmerica::RbdsNone, "", "", "" }
+    ,{ GenreAmerica::RbdsNews, "txt_rad_info_news", "txt_rad_dblist_l1_mhz_val_news", "txt_rad_info_news_hs" }
+    ,{ GenreAmerica::RbdsInformation, "txt_rad_info_information", "txt_rad_dblist_l1_mhz_val_information", "txt_rad_info_information_hs" }
+    ,{ GenreAmerica::RbdsSports, "txt_rad_info_sport", "txt_rad_dblist_l1_mhz_val_sport", "txt_rad_info_sport_hs" }
+    ,{ GenreAmerica::RbdsTalk, "txt_rad_info_talk", "txt_rad_dblist_l1_mhz_val_talk", "txt_rad_info_talk_hs" }
+    ,{ GenreAmerica::RbdsRock, "txt_rad_info_rock_music", "txt_rad_dblist_l1_mhz_val_rock_music", "txt_rad_info_rock_music_hs" } //TODO: Check
+    ,{ GenreAmerica::RbdsClassicRock, "txt_rad_info_classic_rock", "txt_rad_dblist_l1_mhz_val_classic_rock", "txt_rad_info_classic_rock_hs" }
+    ,{ GenreAmerica::RbdsAdultHits, "txt_rad_info_adult_hits", "txt_rad_dblist_l1_mhz_val_adult_hits", "txt_rad_info_adult_hits_hs" }
+    ,{ GenreAmerica::RbdsSoftRock, "txt_rad_info_soft_rock", "txt_rad_dblist_l1_mhz_val_soft_rock", "txt_rad_info_soft_rock_hs" }
+    ,{ GenreAmerica::RbdsTop40, "txt_rad_info_top_40", "txt_rad_dblist_l1_mhz_val_top_40", "txt_rad_info_top_40_hs" }
+    ,{ GenreAmerica::RbdsCountry, "txt_rad_info_country_music", "txt_rad_dblist_l1_mhz_val_country_music", "txt_rad_info_country_music_hs" }  //TODO: Check
+    ,{ GenreAmerica::RbdsOldies, "txt_rad_info_oldies_music", "txt_rad_dblist_l1_mhz_val_oldies_music", "txt_rad_info_oldies_music_hs" }  //TODO: Check
+    ,{ GenreAmerica::RbdsSoft, "txt_rad_info_soft", "txt_rad_dblist_l1_mhz_val_soft", "txt_rad_info_soft_hs" }
+    ,{ GenreAmerica::RbdsNostalgia, "txt_rad_info_nostalgia", "txt_rad_dblist_l1_mhz_val_nostalgia", "txt_rad_info_nostalgia_hs" }
+    ,{ GenreAmerica::RbdsJazz, "txt_rad_info_jazz_music", "txt_rad_dblist_l1_mhz_val_jazz_music", "txt_rad_info_jazz_music_hs" } //TODO: Check
+    ,{ GenreAmerica::RbdsClassical, "txt_rad_info_classical", "txt_rad_dblist_l1_mhz_val_classical", "txt_rad_info_classical_hs" }
+    ,{ GenreAmerica::RbdsRhythmAndBlues, "txt_rad_info_rhythm_and_blues", "txt_rad_dblist_l1_mhz_val_rhythm_and_blues", "txt_rad_info_rhythm_and_blues_hs" }
+    ,{ GenreAmerica::RbdsSoftRhythmAndBlues, "txt_rad_info_soft_rhythm_and_blues", "txt_rad_dblist_l1_mhz_val_soft_rhythm_and_blues", "txt_rad_info_soft_rhythm_and_blues_hs" }
+    ,{ GenreAmerica::RbdsLanguage, "txt_rad_info_language", "txt_rad_dblist_l1_mhz_val_language", "txt_rad_info_language_hs" }
+    ,{ GenreAmerica::RbdsReligiousMusic, "txt_rad_info_religious_music", "txt_rad_dblist_l1_mhz_val_religious_music", "txt_rad_info_religious_music_hs" }
+    ,{ GenreAmerica::RbdsReligiousTalk, "txt_rad_info_religious_talk", "txt_rad_dblist_l1_mhz_val_religious_talk", "txt_rad_info_religious_talk_hs" }
+    ,{ GenreAmerica::RbdsPersonality, "txt_rad_info_personality", "txt_rad_dblist_l1_mhz_val_personality", "txt_rad_info_personality_hs" }
+    ,{ GenreAmerica::RbdsPublic, "txt_rad_info_public", "txt_rad_dblist_l1_mhz_val_public", "txt_rad_info_public_hs" }
+    ,{ GenreAmerica::RbdsCollege, "txt_rad_info_college", "txt_rad_dblist_l1_mhz_val_college", "txt_rad_info_college_hs" }
+    ,{ GenreAmerica::RbdsUnassigned1, "", "", "" }
+    ,{ GenreAmerica::RbdsUnassigned2, "", "", "" }
+    ,{ GenreAmerica::RbdsUnassigned3, "", "", "" }
+    ,{ GenreAmerica::RbdsUnassigned4, "", "", "" }
+    ,{ GenreAmerica::RbdsUnassigned5, "", "", "" }
+    ,{ GenreAmerica::RbdsWeather, "txt_rad_info_weather", "txt_rad_dblist_l1_mhz_val_weather", "txt_rad_info_weather_hs" }//TODO: Check
+    ,{ GenreAmerica::RbdsEmergencyTest, "txt_rad_info_alarm_test", "txt_rad_dblist_l1_mhz_val_alarm_test", "txt_rad_info_alarm_test_hs" }//TODO: Check
+    ,{ GenreAmerica::RbdsEmergency, "txt_rad_info_alarm", "txt_rad_dblist_l1_mhz_val_alarm", "txt_rad_info_alarm_hs" }//TODO: Check
+};
+const int AmericanGenresCount = sizeof( AmericanGenres ) / sizeof ( AmericanGenres[0] );
+
+/*!
+ *
+ */
+bool RadioUiEngine::isOfflineProfile()
+{
+    bool offline = false;
+
+#ifdef BUILD_WIN32
+    QScopedPointer<QSettings> settings( new QSettings( "Nokia", "QtFmRadio" ) );
+    offline = settings->value( "Offline", false ).toBool();
+#else
+    QSystemDeviceInfo deviceInfo;
+    if ( deviceInfo.currentProfile() == QSystemDeviceInfo::OfflineProfile ) {
+        offline = true;
+    }
+#endif
+
+    return offline;
+}
+
+/*!
+ *
+ */
+uint RadioUiEngine::lastTunedFrequency()
+{
+    uint frequency = DEFAULT_MIN_FREQUENCY;
+
+#ifdef BUILD_WIN32
+    QScopedPointer<QSettings> settings( new QSettings( "Nokia", "QtFmRadio" ) );
+    frequency = settings->value( "CurrentFreq", DEFAULT_MIN_FREQUENCY ).toUInt();
+    if ( frequency == 0 ) {
+        frequency = DEFAULT_MIN_FREQUENCY;
+    }
+#else
+    QScopedPointer<XQSettingsManager> settings( new XQSettingsManager() );
+    XQSettingsKey key( XQSettingsKey::TargetCentralRepository, RADIO_CENREP_UID, RADIO_CENREP_FREQUENCY_KEY );
+    frequency = settings->readItemValue( key, XQSettingsManager::TypeInt ).toUInt();
+#endif
+
+    return frequency;
+}
+
+/*!
+ *
+ */
+RadioUiEngine::RadioUiEngine( QObject* parent ) :
+    QObject( parent ),
+    d_ptr( new RadioUiEnginePrivate( this ) )
+{
+}
+
+/*!
+ *
+ */
+RadioUiEngine::~RadioUiEngine()
+{
+    delete d_ptr;
+}
+
+/*!
+ *
+ */
+bool RadioUiEngine::isInitialized() const
+{
+    Q_D( const RadioUiEngine );
+    return !d->mEngineWrapper.isNull();
+}
+
+/*!
+ *
+ */
+bool RadioUiEngine::init()
+{
+    Q_D( RadioUiEngine );
+    return d->init();
+}
+
+/*!
+ *
+ */
+bool RadioUiEngine::isFirstTimeStart()
+{
+    Q_D( RadioUiEngine );
+    return d->mEngineWrapper->settings().isFirstTimeStart();
+}
+
+/*!
+ * Returns the settings handler owned by the engine
+ */
+RadioSettingsIf& RadioUiEngine::settings()
+{
+    Q_D( RadioUiEngine );
+    return d->mEngineWrapper->settings();
+}
+
+/*!
+ * Returns the station model
+ */
+RadioStationModel& RadioUiEngine::stationModel()
+{
+    Q_D( RadioUiEngine );
+    return *d->mStationModel;
+}
+
+/*!
+ * Returns the history model
+ */
+RadioHistoryModel& RadioUiEngine::historyModel()
+{
+    Q_D( RadioUiEngine );
+    return *d->mHistoryModel;
+}
+
+/*!
+ * Creates a new filter model
+ */
+RadioStationFilterModel* RadioUiEngine::createNewFilterModel( QObject* parent )
+{
+    return new RadioStationFilterModel( *this, parent );
+}
+
+/*!
+ * Creates a new carousel model
+ */
+RadioCarouselModel* RadioUiEngine::carouselModel()
+{
+    Q_D( RadioUiEngine );
+    if ( !d->mCarouselModel ) {
+        d->mCarouselModel.reset( new RadioCarouselModel( *this, *d->mStationModel ) );
+    }
+
+    return d->mCarouselModel.data();
+}
+
+/*!
+ *
+ */
+RadioScannerEngine* RadioUiEngine::scannerEngine()
+{
+    Q_D( RadioUiEngine );
+    if ( !d->mScannerEngine ) {
+        d->mScannerEngine = new RadioScannerEngine( *d );
+    }
+    return d->mScannerEngine;
+}
+
+/*!
+ *
+ */
+bool RadioUiEngine::isRadioOn() const
+{
+    Q_D( const RadioUiEngine );
+    return d->mEngineWrapper->isRadioOn();
+}
+
+/*!
+ *
+ */
+bool RadioUiEngine::isScanning() const
+{
+    Q_D( const RadioUiEngine );
+    if ( d->mScannerEngine ) {
+        return d->mScannerEngine->isScanning();
+    }
+    return false;
+}
+
+/*!
+ *
+ */
+bool RadioUiEngine::isMuted() const
+{
+    Q_D( const RadioUiEngine );
+    return d->mEngineWrapper->isMuted();
+}
+
+/*!
+ *
+ */
+bool RadioUiEngine::isAntennaAttached() const
+{
+    Q_D( const RadioUiEngine );
+    return d->mEngineWrapper->isAntennaAttached();
+}
+
+/*!
+ *
+ */
+bool RadioUiEngine::isUsingLoudspeaker() const
+{
+    Q_D( const RadioUiEngine );
+    return d->mEngineWrapper->isUsingLoudspeaker();
+}
+
+/*!
+ * Returns the selected radio region
+ */
+RadioRegion::Region RadioUiEngine::region() const
+{
+    Q_D( const RadioUiEngine );
+    return d->mEngineWrapper->region();
+}
+
+/*!
+ * Returns the currently tuned frequency
+ */
+uint RadioUiEngine::currentFrequency() const
+{
+    Q_D( const RadioUiEngine );
+    return d->mEngineWrapper->currentFrequency();
+}
+
+/*!
+ * Returns the minimum frequency
+ */
+uint RadioUiEngine::minFrequency() const
+{
+    Q_D( const RadioUiEngine );
+    return d->mEngineWrapper->minFrequency();
+}
+
+/*!
+ * Returns the maximum frequency
+ */
+uint RadioUiEngine::maxFrequency() const
+{
+    Q_D( const RadioUiEngine );
+    return d->mEngineWrapper->maxFrequency();
+}
+
+/*!
+ * Returns the frequency step size from the selected region
+ */
+uint RadioUiEngine::frequencyStepSize() const
+{
+    Q_D( const RadioUiEngine );
+    return d->mEngineWrapper->frequencyStepSize();
+}
+
+/*!
+ * Sets the mute status
+ */
+void RadioUiEngine::setMute( bool muted )
+{
+    Q_D( RadioUiEngine );
+    d->mEngineWrapper->setMute( muted );
+}
+
+/*!
+ *
+ */
+QList<RadioStation> RadioUiEngine::stationsInRange( uint minFrequency, uint maxFrequency )
+{
+    Q_D( RadioUiEngine );
+    return d->mStationModel->stationsInRange( minFrequency, maxFrequency );
+}
+
+/*!
+ *
+ */
+QString RadioUiEngine::genreToString( int genre, GenreTarget::Target target )
+{
+    RadioRegion::Region currentRegion = region();
+
+    const GenreStruct* genreArray = currentRegion == RadioRegion::America ? AmericanGenres : EuropeanGenres;
+    const int genreCount = currentRegion == RadioRegion::America ? AmericanGenresCount : EuropeanGenresCount;
+
+    for( int i = 0; i < genreCount; ++i ) {
+        if ( genreArray[i].mGenreCode == genre ) {
+            if ( target == GenreTarget::Carousel ) {
+                return qtTrId( genreArray[i].mInCarousel );
+            } else if ( target == GenreTarget::StationsList ) {
+                return qtTrId( genreArray[i].mInStationsList );
+            } else if ( target == GenreTarget::HomeScreen ) {
+                return qtTrId( genreArray[i].mInHomeScreen );
+            }
+        }
+    }
+
+    return "";
+}
+
+/*!
+ *
+ */
+bool RadioUiEngine::isSongRecognitionAppAvailable()
+{
+    //TODO: Check if there is a better way to check if an application is available
+    bool available = false;
+
+    // Check the Z: drive
+    QString fullPath = QString( KPathFormatter ).arg( "Z" ).arg( KApplicationDir ).arg( KSongRecognitionApp );
+    available = QFile::exists( fullPath );
+
+    LOG_FORMAT( "Checking file: %s. found %d", GETSTRING( fullPath ), available );
+
+    if ( !available ) {
+        // Check the C: drive
+        fullPath = QString( KPathFormatter ).arg( "C" ).arg( KApplicationDir ).arg( KSongRecognitionApp );
+        available = QFile::exists( fullPath );
+        LOG_FORMAT( "Checking file: %s. found %d", GETSTRING( fullPath ), available );
+        if ( !available ) {
+            // Check the E: drive
+            fullPath = QString( KPathFormatter ).arg( "E" ).arg( KApplicationDir ).arg( KSongRecognitionApp );
+            available = QFile::exists( fullPath );
+            LOG_FORMAT( "Checking file: %s. found %d", GETSTRING( fullPath ), available );
+        }
+    }
+    return available;
+}
+
+/*!
+ *
+ */
+void RadioUiEngine::addRecognizedSong( const QString& artist, const QString& title, const RadioStation& station )
+{
+    Q_D( RadioUiEngine );
+    d->mHistoryModel->addItem( artist, title, station );
+}
+
+/*!
+ *
+ */
+uint RadioUiEngine::skipStation( StationSkip::Mode mode, uint startFrequency )
+{
+    Q_D( RadioUiEngine );
+    return d->skip( mode, startFrequency );
+}
+
+/*!
+ *
+ */
+void RadioUiEngine::openMusicStore( const RadioHistoryItem& item, MusicStore store )
+{
+    Q_UNUSED( item );
+    Q_UNUSED( store );
+    //TODO: Integrate to music store
+}
+
+/*!
+ * Public slot
+ * Tunes to the given frequency
+ */
+void RadioUiEngine::tuneFrequency( uint frequency, const int reason )
+{
+    Q_D( RadioUiEngine );
+    if ( frequency != d->mStationModel->currentStation().frequency() && d->mEngineWrapper->isFrequencyValid( frequency ) ) {
+        LOG_FORMAT( "RadioUiEngine::tuneFrequency, frequency: %d", frequency );
+        d->cancelSeeking();
+        d->mEngineWrapper->tuneFrequency( frequency, reason );
+    }
+}
+
+/*!
+ * Public slot
+ * Tunes to the given frequency after a delay
+ */
+void RadioUiEngine::tuneWithDelay( uint frequency, const int reason )
+{
+    Q_D( RadioUiEngine );
+    if ( frequency != d->mStationModel->currentStation().frequency() &&  d->mEngineWrapper->isFrequencyValid( frequency ) ) {
+        LOG_FORMAT( "RadioEngineWrapperPrivate::tuneWithDelay, frequency: %d", frequency );
+        d->cancelSeeking();
+        d->mEngineWrapper->tuneWithDelay( frequency, reason );
+    }
+}
+
+/*!
+ * Public slot
+ * Tunes to the given preset
+ */
+void RadioUiEngine::tunePreset( int presetIndex )
+{
+    Q_D( RadioUiEngine );
+    if ( presetIndex != d->mStationModel->currentStation().presetIndex() ) {
+        RadioStation station;
+        if ( d->mStationModel->findPresetIndex( presetIndex, station ) != RadioStation::NotFound &&
+                d->mEngineWrapper->isFrequencyValid( station.frequency() ) ) {
+            LOG_FORMAT( "RadioEngineWrapperPrivate::tunePreset, presetIndexPosition: %d", presetIndex );
+
+            d->mEngineWrapper->tuneFrequency( station.frequency(), TuneReason::Unspecified );
+        }
+    }
+}
+
+/*!
+ * Public slot
+ * volume update command slot for the engine
+ */
+void RadioUiEngine::setVolume( int volume )
+{
+    Q_D( RadioUiEngine );
+    d->mEngineWrapper->setVolume( volume );
+}
+
+/*!
+ * Public slot
+ *
+ */
+void RadioUiEngine::toggleMute()
+{
+    Q_D( RadioUiEngine );
+    if ( !isScanning() ) {
+        d->mEngineWrapper->setMute( !d->mEngineWrapper->isMuted() );
+    }
+}
+
+/*!
+ * Public slot
+ *
+ */
+void RadioUiEngine::toggleAudioRoute()
+{
+    Q_D( RadioUiEngine );
+    d->mEngineWrapper->toggleAudioRoute();
+}
+
+/*!
+ * Public slot
+ *
+ */
+void RadioUiEngine::seekStation( int seekDirection )
+{
+    if ( isAntennaAttached() ) {
+        Q_D( RadioUiEngine );
+        Seeking::Direction direction = static_cast<Seeking::Direction>( seekDirection );
+        emitSeekingStarted( direction );
+        d->mEngineWrapper->startSeeking( direction, TuneReason::Seek );
+    }
+}
+
+/*!
+ * Public slot
+ *
+ */
+void RadioUiEngine::launchSongRecognition()
+{
+    LOG_FORMAT("RadioUiEngine::launchSongRecognition() starting:  %s", GETSTRING( KSongRecognitionApp ) );
+
+    QStringList arguments;
+    arguments << KSongRecognitionAppParams;
+
+    bool started = QProcess::startDetached( KSongRecognitionApp, arguments );
+    Q_UNUSED( started );
+    LOG_ASSERT( started, LOG_FORMAT("RadioUiEngine::launchSongRecognition() failed to start %s", GETSTRING( KSongRecognitionApp ) ) );
+}
+
+/*!
+ * Function used by the private implementation to emit a tunedToFrequency signal
+ */
+void RadioUiEngine::emitTunedToFrequency( uint frequency, int commandSender )
+{
+    emit tunedToFrequency( frequency, commandSender );
+}
+
+/*!
+ * Function used by the private implementation to emit a seekingStarted signal
+ */
+void RadioUiEngine::emitSeekingStarted( Seeking::Direction direction )
+{
+    emit seekingStarted( direction );
+}
+
+/*!
+ * Function used by the private implementation to emit a radioStatusChanged signal
+ */
+void RadioUiEngine::emitRadioStatusChanged( bool radioIsOn )
+{
+    emit radioStatusChanged( radioIsOn );
+}
+
+/*!
+ * Function used by the private implementation to emit a rdsAvailabilityChanged signal
+ */
+void RadioUiEngine::emitRdsAvailabilityChanged( bool available )
+{
+    emit rdsAvailabilityChanged( available );
+}
+
+/*!
+ * Function used by the private implementation to emit a volumeChanged signal
+ */
+void RadioUiEngine::emitVolumeChanged( int volume )
+{
+    emit volumeChanged( volume );
+}
+
+/*!
+ * Function used by the private implementation to emit a muteChanged signal
+ */
+void RadioUiEngine::emitMuteChanged( bool muted )
+{
+    emit muteChanged( muted );
+}
+
+/*!
+ * Function used by the private implementation to emit a audioRouteChanged signal
+ */
+void RadioUiEngine::emitAudioRouteChanged( bool loudspeaker )
+{
+    emit audioRouteChanged( loudspeaker );
+}
+
+/*!
+ * Function used by the private implementation to emit a antennaStatusChanged signal
+ */
+void RadioUiEngine::emitAntennaStatusChanged( bool connected )
+{
+    emit antennaStatusChanged( connected );
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/src/radiouiengine_p.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,251 @@
+/*
+* 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:
+*
+*/
+
+// System includes
+#include <QApplication>
+#include <QStringList>
+#include <QDateTime>
+#ifndef BUILD_WIN32
+#   include <XQSettingsManager>
+#   include <XQPublishAndSubscribeSettingsKey>
+#   include <XQPublishAndSubscribeUtils>
+#endif
+
+// User includes
+#include "radiouiengine.h"
+#include "radiouiengine_p.h"
+#include "radioenginewrapper.h"
+#include "radiostationmodel.h"
+#include "radiostationmodel_p.h"
+#include "radiohistorymodel.h"
+#include "radiocarouselmodel.h"
+#include "radiopresetstorage.h"
+#include "radiosettings.h"
+#include "radiostation.h"
+#include "radioscannerengine.h"
+#include "radiostationhandlerif.h"
+#ifndef BUILD_WIN32
+#   include "radiocontrolservice.h"
+#   include "radiomonitorservice.h"
+#else
+#   include "radiomonitorservice_win32.h"
+#endif
+#include "radioservicedef.h"
+#include "radiologger.h"
+
+/*!
+ *
+ */
+RadioUiEnginePrivate::RadioUiEnginePrivate( RadioUiEngine* engine ) :
+    q_ptr( engine )
+{
+}
+
+/*!
+ *
+ */
+RadioUiEnginePrivate::~RadioUiEnginePrivate()
+{
+#ifndef BUILD_WIN32
+    XQSettingsManager settingsManager;
+    XQPublishAndSubscribeUtils utils( settingsManager );
+    XQPublishAndSubscribeSettingsKey radioStartupKey( KRadioPSUid, KRadioStartupKey );
+    bool deleted = utils.deleteProperty( radioStartupKey );
+    LOG_ASSERT( deleted, LOG( "RadioUiEnginePrivate::~RadioUiEnginePrivate(). Failed to delete P&S key" ) );
+#endif
+}
+
+/*!
+ *
+ */
+RadioUiEngine& RadioUiEnginePrivate::api()
+{
+    Q_Q( RadioUiEngine );
+    return *q;
+}
+
+/*!
+ *
+ */
+bool RadioUiEnginePrivate::init()
+{
+#ifndef BUILD_WIN32
+    mControlService.reset( new RadioControlService( *q_ptr ) );
+#endif
+    mMonitorService.reset( new RadioMonitorService( *this ) );
+    mStationModel.reset( new RadioStationModel( *this ) );
+    mEngineWrapper.reset( new RadioEngineWrapper( mStationModel->stationHandlerIf() ) );
+    mEngineWrapper->addObserver( this );
+    mPresetStorage.reset( new RadioPresetStorage() );
+    mStationModel->initialize( mPresetStorage.data(), mEngineWrapper.data() );
+    mHistoryModel.reset( new RadioHistoryModel( *q_ptr ) );
+
+#ifndef BUILD_WIN32
+    // Write the startup timestamp to P&S key for the homescreen widget
+    XQSettingsManager settingsManager;
+    XQPublishAndSubscribeUtils utils( settingsManager );
+    XQPublishAndSubscribeSettingsKey radioStartupKey( KRadioPSUid, KRadioStartupKey );
+    bool defined = utils.defineProperty( radioStartupKey, XQSettingsManager::TypeInt );
+    if ( defined ) {
+        settingsManager.writeItemValue( radioStartupKey, (int)QDateTime::currentDateTime().toTime_t() );
+    }
+#endif
+
+    mMonitorService->init();
+
+    return mEngineWrapper->isEngineConstructed();
+}
+
+/*!
+ *
+ */
+void RadioUiEnginePrivate::cancelSeeking()
+{
+    mEngineWrapper->cancelSeeking();
+}
+
+/*!
+ *
+ */
+RadioEngineWrapper& RadioUiEnginePrivate::wrapper()
+{
+    return *mEngineWrapper;
+}
+
+/*!
+ *
+ */
+void RadioUiEnginePrivate::tunedToFrequency( uint frequency, int reason )
+{
+    Q_Q( RadioUiEngine );
+    q->emitTunedToFrequency( frequency, reason );
+}
+
+/*!
+ *
+ */
+void RadioUiEnginePrivate::radioStatusChanged( bool radioIsOn )
+{
+    Q_Q( RadioUiEngine );
+    q->emitRadioStatusChanged( radioIsOn );
+
+    if ( radioIsOn ) {
+        Q_Q( RadioUiEngine );
+        QStringList args; // = qApp->arguments();
+        if ( args.count() == 2 )
+        {
+            if ( args.at( 0 ) == "-f" ) // Frequency
+            {
+                uint frequency = args.at( 1 ).toUInt();
+
+                if ( frequency >= mEngineWrapper->minFrequency() && frequency <= mEngineWrapper->maxFrequency() )
+                {
+                    LOG_FORMAT( "RadioApplication::handleArguments, Tuning to frequency: %d", frequency );
+                    q->tuneFrequency( frequency, 0 );
+                }
+            }
+            else if ( args.at( 0 ) == "-i" ) // Preset index
+            {
+                int preset = args.at( 1 ).toInt();
+                if ( preset > 0 && preset < mStationModel->rowCount() )
+                {
+                    LOG_FORMAT( "RadioApplication::handleArguments, Tuning to preset %d", preset );
+                    q->tunePreset( preset );
+                }
+            }
+        }
+    }
+}
+
+/*!
+ *
+ */
+void RadioUiEnginePrivate::rdsAvailabilityChanged( bool available )
+{
+    Q_Q( RadioUiEngine );
+    q->emitRdsAvailabilityChanged( available );
+}
+
+/*!
+ *
+ */
+void RadioUiEnginePrivate::volumeChanged( int volume )
+{
+    Q_Q( RadioUiEngine );
+    q->emitVolumeChanged( volume );
+}
+
+/*!
+ *
+ */
+void RadioUiEnginePrivate::muteChanged( bool muted )
+{
+    Q_Q( RadioUiEngine );
+    q->emitMuteChanged( muted );
+}
+
+/*!
+ *
+ */
+void RadioUiEnginePrivate::audioRouteChanged( bool loudspeaker )
+{
+    Q_Q( RadioUiEngine );
+    q->emitAudioRouteChanged( loudspeaker );
+}
+
+/*!
+ *
+ */
+void RadioUiEnginePrivate::antennaStatusChanged( bool connected )
+{
+    Q_Q( RadioUiEngine );
+    q->emitAntennaStatusChanged( connected );
+}
+
+/*!
+ *
+ */
+void RadioUiEnginePrivate::skipPrevious()
+{
+    skip( StationSkip::PreviousFavorite );
+}
+
+/*!
+ *
+ */
+void RadioUiEnginePrivate::skipNext()
+{
+    skip( StationSkip::NextFavorite );
+}
+
+/*!
+ * Tunes to next or previous station
+ */
+uint RadioUiEnginePrivate::skip( StationSkip::Mode mode, uint startFrequency )
+{
+    LOG_FORMAT( "RadioUiEnginePrivate::skip: mode: %d", mode );
+    if ( startFrequency == 0 ) {
+        startFrequency = mEngineWrapper->currentFrequency();
+    }
+
+    const uint newFrequency = mStationModel->findClosest( startFrequency, mode ).frequency();
+
+    LOG_FORMAT( "RadioUiEnginePrivate::skip. CurrentFreq: %u, tuning to: %u", startFrequency, newFrequency );
+    mEngineWrapper->tuneFrequency( newFrequency, TuneReason::Skip );
+    return newFrequency;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/tsrc/inc/t_radiostation.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,138 @@
+/*
+* 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 T_RADIOSTATION_H_
+#define T_RADIOSTATION_H_
+
+
+// INCLUDES
+#include <QtTest/QtTest>
+
+#include "radioenginewrapperobserver.h"
+#include "radiostation.h"
+
+class RadioUiEngine;
+class RadioStationModel;
+class RadioHistoryModel;
+class RadioPresetStorage;
+class RadioEngineWrapper;
+class RadioEngineWrapperObserver;
+
+class TestRadioUiEngine : public QObject, RadioEngineWrapperObserver
+{
+    Q_OBJECT
+
+    /**
+     * Flags to indicate which slots have been entered since calling API method. 
+     * Declared to use QFlags<> to ease flag usage and to enforce type safety.
+     */
+    enum SlotEnteredFlag
+    {
+    	NoSlotsEntered               = 0
+        ,StationDataChanged     = 1 << 0
+        ,FavoriteChanged        = 1 << 1
+        ,StationAdded           = 1 << 2
+        ,DataChanged            = 1 << 3
+        ,ItemAdded              = 1 << 4
+    };
+    Q_DECLARE_FLAGS( Slots, SlotEnteredFlag )    
+    
+public:
+
+    TestRadioUiEngine();
+    ~TestRadioUiEngine();    
+
+public slots:
+    void dataChanged(const QModelIndex topLeft, const QModelIndex bottomRight);
+    void stationAdded( RadioStation addedStation );    
+    void stationDataChanged( RadioStation station );        
+    void favoriteChanged( RadioStation station );
+    void itemAdded();
+    
+private slots:
+    // test framework called slots 
+    void initTestCase();
+    void init();
+    void cleanup();
+    void cleanupTestCase();
+    void testImplicitSharing();
+    void testChangeFlags();
+    void TestCallSignChar();
+    void testPICodeToCallSign();
+    void testRadioStationModel();
+    void testhistoryModel();
+    void testHistoryModelItem();
+    
+private:
+
+    // from base class RadioEngineWrapperObserver
+    void tunedToFrequency( uint frequency, int commandSender );
+    void seekingStarted( Seeking::Direction direction );
+    void radioStatusChanged( bool radioIsOn );
+    void rdsAvailabilityChanged( bool available );
+    void volumeChanged( int volume );
+    void muteChanged( bool muted );
+    void audioRouteChanged( bool loudspeaker );
+    void scanAndSaveFinished();
+    void headsetStatusChanged( bool connected );
+    void skipPrevious();
+    void skipNext();
+    // subfunctions used by the test framework called slots
+    void testRadioStationModelInit();
+    void testAddStation1();
+    void testSaveStation1();
+    void testAddStation2();
+    void testSaveStation2();
+    void testAddStation3();
+    void testSaveStation3();
+    void testSortByFrequency();
+    void testFindPresetIndex();
+    void testRemoveByFrequency();
+    void testRemoveByPresetIndex();
+    void testRemoveStation();
+
+    void testSetFavorite();
+
+    void testRenameStation();
+    void testSetRadioTextPlus();
+    void testHistoryModelInit();
+    void testHistoryModelAddItem();
+    void testHistoryModelFindItem();
+    void testHistoryModelUpdateItem();
+    void testHistoryModelSetData();
+    void testAddRadioTextPlus();
+    void testClearRadioTextPlus();
+    void testRadioHistoryItem();
+    
+private:
+	RadioUiEngine* mUiEngine;
+	QScopedPointer<RadioEngineWrapper>  mEngineWrapper;
+	RadioStationModel* mRadioStationModel;
+	RadioHistoryModel* mhistoryModel;
+	QScopedPointer<RadioPresetStorage>  mPresetStorage;
+	int mExpectedStationCount;	
+	/**
+	 * Internal book keeping used to determine which slots have been entered since calling RadioStationModel 
+	 * API method. Used to conclude if the correct signals from RadioStationModel have been received.
+	 */
+	Slots mEnteredSlots;
+	QString mStationToBeAdded;
+	QString mStationToBeSaved;
+};
+
+#endif /* T_RADIOSTATION_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/tsrc/src/t_radiostation.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,1014 @@
+/*
+* 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: radiostation test implementation
+*
+*/
+
+#define UNIT_TESTS_FOR_10_1
+#ifdef UNIT_TESTS_FOR_10_1
+#include <e32base.h>
+#include <eikenv.h>
+#endif
+#include "t_radiostation.h"
+#include "radiopresetstorage.h"
+#include "radiostation.h"
+#include "radiostationmodel.h"
+#include "radiohistorymodel.h"
+#include "radioenginewrapper.h"
+#include "radiouiengine.h"
+#include "radiologger.h" //connectAndTest
+
+// Constants
+const uint KTestFrequency1 = 89000000;
+const uint KTestFrequency2 = 89500000;
+const uint KTestFrequency3 = 90000000;
+const uint KTestFrequency4 = 90500000;
+const uint KTestFrequency5 = 91000000;
+const uint KTestFrequency6 = 91500000;
+const uint KTestGenre1 = 1;
+const uint KTestGenre2 = 2;
+const QString KTestStationName1 = "Radio Noice";
+const QString KTestStationName2 = "RN RENAMED";
+const QString KTestUrl1 = "http://qt.nokia.com";
+const QString KTestUrl2 = "http://www.radionoice.com";
+const QString KTestFrequencyString1 = "89000000";
+const QString KTestFrequencyString2 = "89500000";
+const QString KTestFrequencyString3 = "90000000";
+const QString KTestFrequencyString6 = "91500000";
+const QString KTestArtist1 = "Eläkeläiset";
+const QString KTestArtist2 = "Jope";
+const QString KTestArtist3 = "Motorhead";
+const QString KTestTitle1 = "Humppa^2";
+const QString KTestTitle2 = "´åäö´ ^&%¤^";
+const QString KTestTitle3 = "Dancing queen";
+const QString KTestRadioTextRadioText = "NOW! Metallica - Enter sandman in MusicStore for free";
+const QString KTestRadioTextPlusArtist = "Metallica";
+const QString KTestRadioTextPlusTitle = "Enter sandman";
+const QString KTestRadioTextPlusUrl = "www.metallica.com";
+const QString KTestRadioTextPlusUnsupportedTag = "*#*#*#";
+const QString KTestDynamicPSText = "MAKKARAA";
+
+/*!
+ *
+ */
+int main(int /* argc*/, char *argv[])
+{
+    TestRadioUiEngine tv;
+
+    char *pass[3];
+    pass[0] = argv[0];
+    pass[1] = "-o";
+    pass[2] = "c:\\data\\testradiouiengine.txt";
+
+    int res = QTest::qExec(&tv, 3, pass);
+
+    return res;
+}
+
+
+TestRadioUiEngine::TestRadioUiEngine()
+{
+}
+
+
+void TestRadioUiEngine::tunedToFrequency( uint /* frequency */, int /* commandSender */)
+{
+}
+
+
+void TestRadioUiEngine::seekingStarted( Seeking::Direction /* direction */)
+{
+}
+    
+void TestRadioUiEngine::radioStatusChanged( bool /* radioIsOn */)
+{
+}
+    
+void TestRadioUiEngine::rdsAvailabilityChanged( bool /* available */)
+{
+}
+    
+void TestRadioUiEngine::volumeChanged( int /* volume */)
+{
+}
+    
+void TestRadioUiEngine::muteChanged( bool /* muted */)
+{
+}
+
+void TestRadioUiEngine::audioRouteChanged( bool /* loudspeaker */)
+{
+}
+
+void TestRadioUiEngine::scanAndSaveFinished()
+{
+}
+
+    
+void TestRadioUiEngine::headsetStatusChanged( bool /* connected */)
+{
+}
+        
+void TestRadioUiEngine::skipPrevious()
+{
+}
+    
+void TestRadioUiEngine::skipNext()
+{
+}
+
+/*!
+ * Destructor
+ */
+TestRadioUiEngine::~TestRadioUiEngine()
+{
+	delete mRadioStationModel;	
+	delete mUiEngine;
+}
+
+/*!
+ * called before each testfunction is executed
+ */
+void TestRadioUiEngine::init()
+{
+}
+
+/*!
+ * called after every testfunction
+ */
+void TestRadioUiEngine::cleanup()
+{
+}
+
+/*!
+ * called before the first testfunction is executed
+ */
+void TestRadioUiEngine::initTestCase()
+{
+#ifdef UNIT_TESTS_FOR_10_1
+// Workaround for the below panic, occured after porting to 10.1 
+// Main Panic E32USER-CBase 44
+// Create and install the active scheduler
+    CActiveScheduler* scheduler = new(ELeave) CActiveScheduler;
+    CleanupStack::PushL(scheduler);
+    CActiveScheduler::Install(scheduler);
+// CCoeEnv::Static() call in CRadioEngineTls returns NULL
+    CCoeEnv* env = new CCoeEnv;
+#endif 
+    mUiEngine = new RadioUiEngine;
+    mRadioStationModel = new RadioStationModel( *mUiEngine );
+    mhistoryModel = new RadioHistoryModel( *mUiEngine );
+    
+    mEngineWrapper.reset( new RadioEngineWrapper( mRadioStationModel->stationHandlerIf(), *this ) );
+    mPresetStorage.reset( new RadioPresetStorage() );
+    mRadioStationModel->initialize( mPresetStorage.data(), mEngineWrapper.data() );
+    
+    //TODO:: Check why ASSERT fails when mModel->rowCount() == 0 
+    if(mRadioStationModel->rowCount()>0)
+    {
+    	mRadioStationModel->removeAll(); //ASSERT: \"last >= first\" in file qabstractitemmodel.cpp, line 2110	
+    }    
+
+    connectAndTest( mRadioStationModel,  SIGNAL(dataChanged(const QModelIndex, const QModelIndex)),
+        this,    SLOT(dataChanged(const QModelIndex, const QModelIndex)) );
+    
+    connectAndTest( mRadioStationModel,           SIGNAL(stationAdded(RadioStation)),
+        this,    SLOT(stationAdded(RadioStation)) );
+    
+    connectAndTest( mRadioStationModel,           SIGNAL(stationDataChanged(RadioStation)),
+        this,    SLOT(stationDataChanged(RadioStation)) );
+    
+    connectAndTest( mRadioStationModel,           SIGNAL(favoriteChanged(RadioStation)),
+        this,    SLOT(favoriteChanged(RadioStation)) );
+    
+    connectAndTest( mhistoryModel,           SIGNAL(itemAdded()),
+        this,    SLOT(itemAdded()) );
+}
+
+/*!
+ * called after the last testfunction was executed
+ */
+void TestRadioUiEngine::cleanupTestCase()
+{
+	delete mRadioStationModel;
+	delete mUiEngine;
+}
+
+/*!
+ * 
+ */
+void TestRadioUiEngine::dataChanged(const QModelIndex /* topLeft */, const QModelIndex /* bottomRight */)
+{
+	mEnteredSlots |= DataChanged;
+}
+
+/*!
+ * 
+ */
+void TestRadioUiEngine::stationDataChanged( RadioStation /* addedStation */ )
+{
+	mEnteredSlots |= StationDataChanged;	
+}
+
+/*!
+ * 
+ */
+void TestRadioUiEngine::favoriteChanged( RadioStation /* addedStation */)
+{
+	mEnteredSlots |= FavoriteChanged;
+}
+
+/*!
+ * 
+ */
+void TestRadioUiEngine::itemAdded()
+{
+    mEnteredSlots |= ItemAdded;
+}
+
+/*!
+ * 
+ */
+void TestRadioUiEngine::stationAdded( RadioStation addedStation )
+{
+	mEnteredSlots |= StationAdded;
+	
+	QVERIFY2(( mStationToBeAdded == addedStation.name() ), "API:RadioStationModel stationAdded 1");
+	QVERIFY2(( mExpectedStationCount == mRadioStationModel->rowCount() ), "API:RadioStationModel stationAdded 2");	
+}
+
+
+/*!
+ * Testing of implicit sharing a.k.a. copy-on-write
+ */
+void TestRadioUiEngine::testImplicitSharing()
+{	
+	RadioStation t_RadioStation_1;
+	
+	int originalPresetIndex = t_RadioStation_1.presetIndex();
+	// before any values assigned into any data field
+	QVERIFY2(( originalPresetIndex == RadioStation::SharedNull ), "API:Radiostation init failed 1");
+	t_RadioStation_1.setName("Noice");
+	originalPresetIndex = t_RadioStation_1.presetIndex();
+	// once some value assigned into some other data field
+	QVERIFY2(( originalPresetIndex == RadioStation::Invalid ), "API:Radiostation init failed 2");
+		
+	t_RadioStation_1.setFrequency( KTestFrequency1 );
+	//const int newIndex = mModel->findUnusedPresetIndex();
+	t_RadioStation_1.setPresetIndex( 2 );
+	t_RadioStation_1.setGenre(1);
+	t_RadioStation_1.setUrl("http://qt.nokia.com");			
+	
+	RadioStation* t_RadioStation_2 = new RadioStation(t_RadioStation_1);
+	// test that changing the content of copied data doesn't cause
+	// detach in the copying data structure
+	uint originalFrequency = t_RadioStation_1.frequency();
+    t_RadioStation_1.setFrequency( originalFrequency + 1 );
+    // should be detached
+	bool detached = t_RadioStation_2->isDetached();
+	QVERIFY2(detached, "API:Radiostation Implicit sharing/ freq 1");
+	
+	// test that changing the content of data sets detach true
+	originalFrequency = t_RadioStation_2->frequency();
+	t_RadioStation_2->setFrequency( originalFrequency + 1 );
+	// should be detached
+	detached = t_RadioStation_2->isDetached();	
+	QVERIFY2(detached, "API:Radiostation Implicit sharing/ freq 2");	
+	delete t_RadioStation_2;
+	t_RadioStation_2 = NULL;
+	
+	//-------------------------------------------------------------------------
+	// test that changing the content of copied data doesn't cause
+	// detach in the copying data structure
+	t_RadioStation_2 = new RadioStation(t_RadioStation_1);
+	// should not be detached
+	detached = t_RadioStation_2->isDetached();
+	QVERIFY2(!detached, "API:Radiostation Implicit sharing/ preset index 1");
+	originalPresetIndex = t_RadioStation_1.presetIndex();
+	t_RadioStation_1.setPresetIndex( originalPresetIndex + 1 );
+	// should be detached
+	detached = t_RadioStation_2->isDetached();
+	QVERIFY2(detached, "API:Radiostation Implicit sharing/ preset index 2");
+	
+	// test that changing the content of data sets detach true
+	originalPresetIndex = t_RadioStation_2->presetIndex();
+	//newIndex = mModel->findUnusedPresetIndex();
+	t_RadioStation_2->setPresetIndex( originalPresetIndex + 1 );
+	// should be detached
+	detached = t_RadioStation_2->isDetached();
+	QVERIFY2(detached, "API:Radiostation Implicit sharing/ preset index 3");	
+    delete t_RadioStation_2;
+    t_RadioStation_2 = NULL;
+    
+    // test that changing the content of copied data doesn't cause
+    // detach in the copying data structure
+    t_RadioStation_2 = new RadioStation(t_RadioStation_1);
+    // should not be detached
+    detached = t_RadioStation_2->isDetached();
+    QVERIFY2(!detached, "API:Radiostation Implicit sharing/ name 1");
+    //QString originalName = t_RadioStation_1.name(); 
+    t_RadioStation_1.setName("RadioOne");
+    // should be detached
+    detached = t_RadioStation_2->isDetached();
+    QVERIFY2(detached, "API:Radiostation Implicit sharing/ name 2");
+    // test that changing the content of data sets detach true
+    t_RadioStation_2->setName("RadioTwo");
+    // should be detached
+    detached = t_RadioStation_2->isDetached();
+    QVERIFY2(detached, "API:Radiostation  Implicit sharing/ name 3");
+}
+
+/*!
+ * Testing of change flags set by RadioStation class
+ */
+void TestRadioUiEngine::testChangeFlags()
+{
+	RadioStation t_RadioStation;
+		
+    QVERIFY2(!t_RadioStation.isValid(), "API:Radiostation Init failure");
+    t_RadioStation.setUserDefinedName("");
+	t_RadioStation.setUserDefinedName("Radio Noice");
+	t_RadioStation.setFrequency( KTestFrequency1 );
+	//const int newIndex = mModel->findUnusedPresetIndex();
+	t_RadioStation.setPresetIndex( 2 );
+	t_RadioStation.setGenre( KTestGenre1 );
+	t_RadioStation.setUrl( KTestUrl1 );	
+	
+	t_RadioStation.resetChangeFlags();
+	bool persistentDataChanged = t_RadioStation.hasDataChanged( RadioStation::PersistentDataChanged );
+    QVERIFY2(!persistentDataChanged, "API:Radiostation Change flags/ PersistentDataChanged 1");	
+    t_RadioStation.setUserDefinedName("Radio Noice+");
+	bool nameChanged = t_RadioStation.hasDataChanged( RadioStation::NameChanged );	
+	QVERIFY2(nameChanged, "API:Radiostation Change flags/ NameChanged");	
+	persistentDataChanged = t_RadioStation.hasDataChanged( RadioStation::PersistentDataChanged );
+	QVERIFY2(persistentDataChanged, "API:Radiostation Change flags/ PersistentDataChanged 2");	
+	t_RadioStation.resetChangeFlags();
+			
+	uint originalGenre = t_RadioStation.genre();
+	t_RadioStation.setGenre( originalGenre + 1 );
+	bool genreChanged = t_RadioStation.hasDataChanged( RadioStation::GenreChanged );
+	QVERIFY2(genreChanged, "API:Radiostation Change flags/ GenreChanged");	
+	persistentDataChanged = t_RadioStation.hasDataChanged( RadioStation::PersistentDataChanged );
+	QVERIFY2(persistentDataChanged, "API:Radiostation Change flags/ PersistentDataChanged 3");	
+	t_RadioStation.resetChangeFlags();
+	
+	QString originalUrl = t_RadioStation.url();
+	t_RadioStation.setUrl(originalUrl);
+	// previous url set so no url or persistent data change flags should be set
+	bool urlChanged = t_RadioStation.hasDataChanged( RadioStation::UrlChanged );
+	QVERIFY2(!urlChanged, "API:Radiostation Change flags/ UrlChanged");
+	persistentDataChanged = t_RadioStation.hasDataChanged( RadioStation::PersistentDataChanged );
+    QVERIFY2(!persistentDataChanged, "API:Radiostation Change flags/ PersistentDataChanged 4");	
+	t_RadioStation.resetChangeFlags();
+	
+	QString originalRadioText = t_RadioStation.radioText();
+	t_RadioStation.setRadioText( originalRadioText + "buy sausage" );
+	bool radioTextChanged = t_RadioStation.hasDataChanged( RadioStation::RadioTextChanged );
+	QVERIFY2(radioTextChanged, "API:Radiostation Change flags/ RadioTextChanged");
+	// radio text not stored into cenrep
+	persistentDataChanged = t_RadioStation.hasDataChanged( RadioStation::PersistentDataChanged );
+	QVERIFY2(!persistentDataChanged, "API:Radiostation Change flags/ PersistentDataChanged 5");
+	t_RadioStation.resetChangeFlags();
+	t_RadioStation.setRadioText( t_RadioStation.radioText() );
+	// because current radio text is reset change flags must not be affected
+	radioTextChanged = t_RadioStation.hasDataChanged( RadioStation::RadioTextChanged );
+	QVERIFY2(!radioTextChanged, "API:Radiostation Change flags/ RadioTextChanged");
+	t_RadioStation.resetChangeFlags();
+	
+	QVERIFY2((t_RadioStation.psType()==RadioStation::Unknown), "API:Radiostation PS type check");	
+	t_RadioStation.setPsType( RadioStation::Dynamic );
+	bool psTypeChanged = t_RadioStation.hasDataChanged( RadioStation::PsTypeChanged );
+	QVERIFY2(psTypeChanged, "API:Radiostation Change flags/ PsTypeChanged");
+	persistentDataChanged = t_RadioStation.hasDataChanged( RadioStation::PersistentDataChanged );
+	// PS type not stored as persistent data
+	QVERIFY2(!persistentDataChanged, "API:Radiostation Change flags/ PersistentDataChanged 6");
+	t_RadioStation.resetChangeFlags();
+	
+	t_RadioStation.setFavorite(t_RadioStation.isFavorite());
+	bool favouriteChanged = t_RadioStation.hasDataChanged( RadioStation::FavoriteChanged );
+    QVERIFY2(!favouriteChanged, "API:Radiostation Change flags/ FavoriteChanged");    
+    persistentDataChanged = t_RadioStation.hasDataChanged( RadioStation::PersistentDataChanged );
+    QVERIFY2(!persistentDataChanged, "API:Radiostation Change flags/ PersistentDataChanged 7");
+    t_RadioStation.resetChangeFlags();
+    
+    // initially there should not be PI code defined
+    QVERIFY2(!t_RadioStation.hasPiCode(), "API:Radiostation Pi code check");
+    // non-clear channel
+    t_RadioStation.setPiCode(0xC004, RadioRegion::Default); //88.1 CBEE-FM - Chatham, ON
+    bool piCodeChanged = t_RadioStation.hasDataChanged( RadioStation::PiCodeChanged );
+    QVERIFY2(piCodeChanged, "API:Radiostation Change flags/ PiCodeChanged");
+    persistentDataChanged = t_RadioStation.hasDataChanged( RadioStation::PersistentDataChanged );
+    QVERIFY2(persistentDataChanged, "API:Radiostation Change flags/ PersistentDataChanged 8");
+}
+
+/*!
+ * Testing of call sign integer to char conversion
+ */
+void TestRadioUiEngine::TestCallSignChar()
+{
+	for(uint i = 0; i < KLastCallSignCharCode; i++)
+	{
+	    RadioStation t_RadioStation;
+	    bool passed =  t_RadioStation.callSignChar(i) == static_cast<char>( 'A' + i ); 	    	
+	    QVERIFY2(passed, "API:Radiostation TestCallSignChar 1");	
+	}
+	RadioStation t_RadioStation;
+	bool passed = t_RadioStation.callSignChar(KLastCallSignCharCode + 1) == static_cast<char>( '?' );
+	QVERIFY2(passed, "API:Radiostation TestCallSignChar 2");
+}
+
+/*!
+ * Testing of PI code to call sign conversion
+ */
+void TestRadioUiEngine::testPICodeToCallSign()
+{
+	RadioStation t_RadioStation;
+	
+	// boundary values, two typical values and three chars call sign case
+	QString callSign = t_RadioStation.piCodeToCallSign( KKxxxCallSignPiFirst - 1 );
+	QVERIFY2((callSign==""), "API:Radiostation Call sign <");
+	callSign = t_RadioStation.piCodeToCallSign( KKxxxCallSignPiFirst );
+	QVERIFY2((callSign=="KAAA"), "API:Radiostation Call sign KAAA");
+	callSign = t_RadioStation.piCodeToCallSign( 0x243F );
+	QVERIFY2((callSign=="KHRJ"), "API:Radiostation Call sign KHRJ");
+	callSign = t_RadioStation.piCodeToCallSign( KWxxxCallSignPiFirst - 1 );
+	QVERIFY2((callSign=="KZZZ"), "API:Radiostation Call sign KZZZ");
+	callSign = t_RadioStation.piCodeToCallSign( KWxxxCallSignPiFirst );
+	QVERIFY2((callSign=="WAAA"), "API:Radiostation Call sign WAAA");
+	callSign = t_RadioStation.piCodeToCallSign( 0x74B9 );
+    QVERIFY2((callSign=="WMDT"), "API:Radiostation Call sign WMDT");
+    callSign = t_RadioStation.piCodeToCallSign( KWxxxCallSignPiLast );
+    QVERIFY2((callSign=="WZZZ"), "API:Radiostation Call sign WZZZ");
+    callSign = t_RadioStation.piCodeToCallSign( KWxxxCallSignPiLast + 1 );
+    QVERIFY2((callSign=="KEX"), "API:Radiostation Call sign KEX");
+    callSign = t_RadioStation.piCodeToCallSign( 0x99B5 );
+    QVERIFY2((callSign=="WJZ"), "API:Radiostation Call sign WJZ");    
+    callSign = t_RadioStation.piCodeToCallSign( 0x99C0 );
+    QVERIFY2((callSign==""), "API:Radiostation Call sign ????");
+}
+
+/*!
+ * Testing of RadioStationModel initial state
+ */
+void TestRadioUiEngine::testRadioStationModelInit()
+{
+	//TODO:: Check why ASSERT fails when mModel->rowCount() == 0 
+	if( mRadioStationModel->rowCount()>0 )
+    {	    
+		mRadioStationModel->removeAll();
+		QVERIFY2((mRadioStationModel->rowCount()==0), "API:RadioStationModel removeAll()");
+	}
+		 
+	RadioStation foundStation;
+	// no stations in the model in this phase
+	QVERIFY2(!(mRadioStationModel->findFrequency( KTestFrequency1, foundStation )), 
+		"API:RadioStationModel findFrequency 1");	
+}
+
+/*!
+ * Testing of RadioStationModel addStation method and resulting RadioStationModel signals
+ */
+void TestRadioUiEngine::testAddStation1()
+{
+	RadioStation station;
+	station.setFrequency( KTestFrequency1 );
+	station.setFrequency( KTestFrequency1 );
+	station.setGenre( KTestGenre1 );
+	station.setGenre( KTestGenre1 );
+	station.setUrl( KTestUrl1 );    
+	station.setType( RadioStation::LocalStation );
+	station.setType( RadioStation::LocalStation );
+	station.setName("");
+	station.setName( KTestStationName1 );
+	station.setDynamicPsText( KTestDynamicPSText );
+	station.setPiCode( 0xC004, RadioRegion::America ); //88.1 CBEE-FM - Chatham, ON
+    QVERIFY2(!(station.dynamicPsText().compare(KTestDynamicPSText)), "API:RadioStationModel addStation 1");
+    station.setDynamicPsText( KTestDynamicPSText );
+	// check that adding station increases model row count
+	mExpectedStationCount = mRadioStationModel->rowCount() + 1;	
+	mStationToBeAdded = station.name();
+	mRadioStationModel->addStation( station );
+	QVERIFY2((mRadioStationModel->rowCount()==mExpectedStationCount), "API:RadioStationModel addStation 2");
+	bool correctSignalsReceived = mEnteredSlots.testFlag( StationDataChanged ) && 
+	    mEnteredSlots.testFlag( StationAdded ) && mEnteredSlots.testFlag( DataChanged );
+	
+	bool frequencyUpdated = station.frequencyMhz().toDouble()*1000000 == KTestFrequency1;
+	QVERIFY2(frequencyUpdated, "API:RadioStationModel addStation 1");
+	// check that correct signals received
+	QVERIFY2(correctSignalsReceived, "API:RadioStationModel addStation 3");
+	mEnteredSlots = NoSlotsEntered;
+	
+	// check that added station can be found by frequency
+    QModelIndex index = mRadioStationModel->modelIndexFromFrequency( KTestFrequency1 );
+    QVariant stationData = mRadioStationModel->data( index, Qt::DisplayRole );
+    QString stationName = stationData.toString().right( KTestStationName1.length() );    
+    QVERIFY2(!(stationName.compare(KTestStationName1)), "API:RadioStationModel modelIndexFromFrequency");
+}
+
+/*!
+ * Testing of RadioStationModel saveStation method and resulting RadioStationModel signals
+ */
+void TestRadioUiEngine::testSaveStation1()
+{
+	RadioStation newStation1;
+    // check that find by frequency works
+    // this is needed for preset index to be updated into newStation1
+    QVERIFY2((mRadioStationModel->findFrequency( KTestFrequency1, newStation1 )), 
+        "API:RadioStationModel findFrequency 2");
+    newStation1.setType( RadioStation::Favorite );
+    mRadioStationModel->saveStation( newStation1 );    
+    bool correctSignalsReceived = mEnteredSlots.testFlag( StationDataChanged ) && 
+            mEnteredSlots.testFlag( FavoriteChanged ) && mEnteredSlots.testFlag( DataChanged );;
+    QVERIFY2(correctSignalsReceived, "API:RadioStationModel saveStation 1");
+    
+    newStation1.setGenre(newStation1.genre()+1);
+    mRadioStationModel->saveStation( newStation1 );
+    correctSignalsReceived = mEnteredSlots.testFlag( StationDataChanged  ) && mEnteredSlots.testFlag( DataChanged );
+    // check that correct signals received
+    QVERIFY2(correctSignalsReceived, "API:RadioStationModel saveStation 2");
+}
+
+/*!
+ * Testing of RadioStationModel addStation method and rowCount methods
+ */
+void TestRadioUiEngine::testAddStation2()
+{
+    RadioStation newStation2;
+	newStation2.setFrequency( KTestFrequency2 );
+    QVERIFY2(!newStation2.hasRds(), "API:RadioStationModel addStation 1");
+	newStation2.setGenre( KTestGenre2 );
+	// setting genre should set this true
+	QVERIFY2(newStation2.hasRds(), "API:RadioStationModel addStation 2");
+	newStation2.setUrl( KTestUrl2 );
+    newStation2.setType( RadioStation::LocalStation | RadioStation::Favorite );
+    newStation2.setName("Radio ice");
+    // check that adding station increases model row count
+    mExpectedStationCount = mRadioStationModel->rowCount()+1;
+    mStationToBeAdded = newStation2.name();
+    mRadioStationModel->addStation( newStation2 );
+    
+    QVERIFY2((mRadioStationModel->rowCount()==mExpectedStationCount), "API:RadioStationModel addStation 3");
+    mEnteredSlots = NoSlotsEntered;
+}
+
+/*!
+ * Testing of RadioStationModel saveStation method special cases
+ */
+void TestRadioUiEngine::testSaveStation2()
+{
+    RadioStation newStation1;
+    // this is needed for preset index to be updated into newStation1
+    QVERIFY2((mRadioStationModel->findFrequency( KTestFrequency1, newStation1 )), 
+        "API:RadioStationModel findFrequency 2");
+    
+	newStation1.setFrequency( KTestFrequency2 );	
+	mExpectedStationCount = mRadioStationModel->rowCount();
+	// updating existing station data must not increase station count
+	mRadioStationModel->saveStation( newStation1 );
+	QVERIFY2((mRadioStationModel->rowCount()==mExpectedStationCount), "API:RadioStationModel saveStation 1");    
+    // because frequency tried to be updated no signals should be received either
+	bool correctSignalsReceived = mEnteredSlots.testFlag( NoSlotsEntered );
+    QVERIFY2(correctSignalsReceived, "API:RadioStationModel saveStation 2");
+    mEnteredSlots = NoSlotsEntered;
+    
+    // original frequency resumed
+    newStation1.setFrequency( KTestFrequency1 );
+    newStation1.setGenre(newStation1.genre()+1);
+    mExpectedStationCount = mRadioStationModel->rowCount();
+    // now that frequency resumed signal should be received also
+    mRadioStationModel->saveStation( newStation1 );
+    correctSignalsReceived = mEnteredSlots.testFlag( StationDataChanged ) && mEnteredSlots.testFlag( DataChanged );
+    QVERIFY2(correctSignalsReceived, "API:RadioStationModel saveStation 3");
+    // updating existing station data must not increase station count
+    QVERIFY2((mRadioStationModel->rowCount()==mExpectedStationCount), "API:RadioStationModel saveStation 2");
+    
+    mExpectedStationCount = mRadioStationModel->rowCount();
+    mStationToBeAdded = newStation1.name();
+    // adding station must fail because the frequency is the same as previously used frequency
+    mRadioStationModel->addStation( newStation1 );
+    QVERIFY2((mRadioStationModel->rowCount()==mExpectedStationCount), "API:RadioStationModel addStation 3");
+}
+
+/*!
+ * Testing of RadioStationModel addStation method special cases
+ */
+void TestRadioUiEngine::testAddStation3()
+{
+    RadioStation newStation3;
+    newStation3.setFrequency( KTestFrequency2 );
+    newStation3.setGenre(3);
+    newStation3.setUrl("http://www.radio4noice.com");
+    newStation3.setType( RadioStation::LocalStation | RadioStation::Favorite );
+    newStation3.setName("Radio e");
+    // adding station must fail because frequency is the same as previously used frequency
+    mExpectedStationCount = mRadioStationModel->rowCount();
+    mStationToBeAdded = newStation3.name();
+    mRadioStationModel->addStation( newStation3 );    
+    QVERIFY2((mRadioStationModel->rowCount()==mExpectedStationCount), "API:RadioStationModel addStation 4");
+    // adding station must success because the station frequency is different now
+    newStation3.setFrequency( KTestFrequency2 + 1 );
+    mExpectedStationCount = mRadioStationModel->rowCount() + 1;
+    mRadioStationModel->addStation( newStation3 );
+    QVERIFY2((mRadioStationModel->rowCount()==mExpectedStationCount), "API:RadioStationModel addStation 5");
+    // test that station can be found by frequency range
+    QList<RadioStation> stations;
+    stations = mRadioStationModel->stationsInRange( KTestFrequency1, KTestFrequency3 );
+    QVERIFY2((stations.count()==3), "API:RadioStationModel stationsInRange");
+}
+
+/*!
+ * Testing of RadioStationModel saveStation method special cases
+ */
+void TestRadioUiEngine::testSaveStation3()
+{
+    RadioStation newStation3;
+    RadioStation foundStation;
+    QVERIFY2(mRadioStationModel->findFrequency( KTestFrequency2 + 1, newStation3 ),			
+        "API:RadioStationModel findFrequency 4");
+    
+    newStation3.setFrequency( KTestFrequency3 );
+    // because frequency or preset index don't have change flag the frequency must not be updated 
+    mRadioStationModel->saveStation( newStation3 );
+
+    QVERIFY2(!(mRadioStationModel->findFrequency( KTestFrequency3, foundStation )),			
+        "API:RadioStationModel findFrequency 3");
+
+    int stationGenre;
+    stationGenre = newStation3.genre();	
+    newStation3.setGenre( newStation3.genre() + 1 );
+    // allthough genre changed so the frequency update must not become effective  
+    mRadioStationModel->saveStation( newStation3 );	
+
+    QVERIFY2(!(mRadioStationModel->findFrequency( KTestFrequency3, foundStation )),			
+        "API:RadioStationModel findFrequency 4");
+    
+
+    mEnteredSlots = NoSlotsEntered;
+    foreach( const RadioStation& station, mRadioStationModel->list() ) 
+    {
+        if ( station.frequency() == KTestFrequency2 ) 
+        {        
+            mRadioStationModel->setFavoriteByFrequency( KTestFrequency2, !station.isFavorite() );
+        }
+    }
+    bool correctSignalsReceived = mEnteredSlots.testFlag( StationDataChanged ) && 
+        mEnteredSlots.testFlag( FavoriteChanged ) && mEnteredSlots.testFlag( DataChanged );
+    QVERIFY2(correctSignalsReceived, "API:RadioStationModel findFrequency 5");
+}
+
+
+
+/*!
+ * Test that stations are stored into RadioStationModel in ascending frequency order  
+ */
+void TestRadioUiEngine::testSortByFrequency()
+{
+	int role = RadioStationModel::RadioStationRole;
+	int previousFrequency(0); // int not initialized zero as default
+	
+	for (int i = 0; i< mRadioStationModel->rowCount(); i++ )
+	{
+		QModelIndex index = mRadioStationModel->index( i, 0 );
+		QVariant stationData = mRadioStationModel->data( index, role );
+		RadioStation station = stationData.value<RadioStation>();
+		// stations must be obtainded at ascending frequency order
+		QVERIFY2((station.frequency()>previousFrequency), "API:RadioStationModel testSortByFrequency");
+		previousFrequency = station.frequency();
+	}
+}
+
+/*!
+ * Test that preset indexes match
+ */
+void TestRadioUiEngine::testFindPresetIndex()
+{
+	RadioStation station;
+	for (int i = 0; i< mRadioStationModel->rowCount(); i++ )
+    {
+		QVERIFY2((mRadioStationModel->findPresetIndex(i) != RadioStation::NotFound), 
+	        "API:RadioStationModel testFindPresetIndex 1");
+		QVERIFY2((mRadioStationModel->findPresetIndex( i, station ) != RadioStation::NotFound), 
+			"API:RadioStationModel testFindPresetIndex 2");
+		QVERIFY2((station.presetIndex() == i), "API:RadioStationModel testFindPresetIndex 3");
+	}
+}
+
+/*!
+ * Test that preset can be removed from model by frequency
+ */
+void TestRadioUiEngine::testRemoveByFrequency()
+{
+	RadioStation station;
+	int initialStationCount( mRadioStationModel->rowCount() );
+	int presetIndex(0);
+	
+	// find valid preset index
+	for(int i = 0; i<mRadioStationModel->rowCount(); i++)
+	{
+		presetIndex = mRadioStationModel->findPresetIndex( i, station );
+		if(presetIndex!=RadioStation::NotFound)
+			break;
+	}
+	QVERIFY2((presetIndex != RadioStation::NotFound), "API:RadioStationModel testRemoveByFrequency 1");
+		
+	mRadioStationModel->removeByFrequency( station.frequency() );	
+	QVERIFY2((mRadioStationModel->rowCount()==(initialStationCount-1)), "API:RadioStationModel testRemoveByFrequency 2");
+}
+
+/*!
+ * Test that station can be removed from model by preset index 
+ */
+void TestRadioUiEngine::testRemoveByPresetIndex()
+{
+	RadioStation station;
+	station.setFrequency( KTestFrequency4 );
+	mStationToBeAdded = "";
+	mExpectedStationCount = mRadioStationModel->rowCount() + 1;
+	mRadioStationModel->addStation( station );
+	// for updating station preset index
+	QVERIFY2((mRadioStationModel->findFrequency( KTestFrequency4, station )), 
+			"API:RadioStationModel testRemoveByPresetIndex 1");
+	
+	int initialStationCount( mRadioStationModel->rowCount() );
+	mRadioStationModel->removeByPresetIndex( station.presetIndex() );    
+    QVERIFY2((mRadioStationModel->rowCount()==(initialStationCount-1)), "API:RadioStationModel testRemoveByPresetIndex 2");
+}
+
+/*!
+ * Test RadioStationModel method removeStation
+ */
+void TestRadioUiEngine::testRemoveStation()
+{
+	RadioStation station;
+	station.setFrequency( KTestFrequency5 );
+	mStationToBeAdded = "";
+	mExpectedStationCount = mRadioStationModel->rowCount() + 1;
+	mRadioStationModel->addStation( station );
+	int initialStationCount( mRadioStationModel->rowCount() );
+	// for updating station preset index
+	QVERIFY2(mRadioStationModel->findFrequency( KTestFrequency5, station ),			
+	        "API:RadioStationModel testRemoveStation");
+	
+	mRadioStationModel->removeStation( station );	
+	QVERIFY2((mRadioStationModel->rowCount()==(initialStationCount-1)), "API:RadioStationModel testRemoveStation");
+}
+
+
+/*!
+ * Test setting and unsetting station type favourite
+ */
+void TestRadioUiEngine::testSetFavorite()
+{	
+	RadioStation station;	
+	station.setFrequency( KTestFrequency6 );
+	station.setType( RadioStation::Favorite );	
+    QVERIFY2(station.isFavorite(), "API:RadioStationModel testSetFavorite 1");
+	mRadioStationModel->addStation( station );
+	mEnteredSlots = NoSlotsEntered;	
+	
+	mRadioStationModel->setFavoriteByFrequency( KTestFrequency6, false );	
+	bool correctSignalsReceived = mEnteredSlots.testFlag( StationDataChanged ) && 
+	    mEnteredSlots.testFlag( FavoriteChanged ) && mEnteredSlots.testFlag( DataChanged );
+	QVERIFY2(correctSignalsReceived, "API:RadioStationModel testSetFavorite 2");
+	
+	mRadioStationModel->findFrequency( KTestFrequency6, station );
+	QVERIFY2(!station.isFavorite(), "API:RadioStationModel testSetFavorite 3");
+	mEnteredSlots = NoSlotsEntered;
+	
+	mRadioStationModel->setFavoriteByPreset( station.presetIndex(), true );
+	correctSignalsReceived = mEnteredSlots.testFlag( StationDataChanged ) && 
+		mEnteredSlots.testFlag( FavoriteChanged ) && mEnteredSlots.testFlag( DataChanged );
+	QVERIFY2(correctSignalsReceived, "API:RadioStationModel testSetFavorite 4");
+    
+	// test toggling the favorite 
+	QModelIndex index = mRadioStationModel->modelIndexFromFrequency( KTestFrequency6 );
+    mRadioStationModel->setData( index, KTestFrequencyString6 ,RadioStationModel::ToggleFavoriteRole);
+    RadioStation station1 = mRadioStationModel->stationAt( index.row() );
+    QVERIFY2(!station1.isFavorite(), "API:RadioStationModel testToggleFavourite");
+
+}
+
+/*!
+ * Test renaming station
+ */
+void TestRadioUiEngine::testRenameStation()
+{	
+	RadioStation station;
+	int presetIndex(0);
+	// find valid preset index
+    for( int i = 0; i<mRadioStationModel->rowCount(); i++ )
+	{
+		if( mRadioStationModel->findPresetIndex( i, station ) != RadioStation::NotFound )
+		{
+			presetIndex = i;
+			break;
+		}
+	}   
+    QString initialStationName( station.name() );
+    mEnteredSlots = NoSlotsEntered;
+	mRadioStationModel->renameStation( presetIndex, initialStationName + "Renamed" );	
+	bool correctSignalsReceived = mEnteredSlots.testFlag( StationDataChanged ) && 
+        mEnteredSlots.testFlag( DataChanged );
+	QVERIFY2(correctSignalsReceived, "API:RadioStationModel testRenameStation 1");	
+    QVERIFY2(initialStationName!=mRadioStationModel->stationAt(presetIndex).name(), "API:RadioStationModel testRenameStation 2");
+        
+    station.setUserDefinedName( KTestStationName2 );
+    QVERIFY2(station.isRenamed(), "API:RadioStationModel testRenameStation 1");
+    
+}
+
+/*!
+ * Test setting radio text
+ */
+void TestRadioUiEngine::testSetRadioTextPlus()
+{
+    RadioStation station;
+    mRadioStationModel->findFrequency( KTestFrequency6, station );
+    station.setRadioText( "" );
+    station.setRadioText( KTestRadioTextRadioText );
+    station.setRadioText( KTestRadioTextRadioText );
+    station.setRadioTextPlus( RtPlus::Artist, KTestRadioTextPlusArtist );
+    station.setRadioTextPlus( RtPlus::Title, KTestRadioTextPlusTitle );
+    station.setRadioTextPlus( RtPlus::Homepage, KTestRadioTextPlusUrl );
+    station.setRadioTextPlus( RtPlus::Homepage + 1, KTestRadioTextPlusUnsupportedTag );
+    mRadioStationModel->saveStation( station );
+    bool effective = station.radioText().contains( KTestRadioTextPlusArtist, Qt::CaseSensitive );
+    QVERIFY2(effective, "API:RadioStationModel testSetRadioTextPlus 1");
+    effective = station.radioText().contains( KTestRadioTextPlusTitle, Qt::CaseSensitive );
+    QVERIFY2(effective, "API:RadioStationModel testSetRadioTextPlus 2");
+    effective = !station.url().compare( KTestRadioTextPlusUrl );
+    QVERIFY2(effective, "API:RadioStationModel testSetRadioTextPlus 3");
+}
+
+/*!
+ * Test RadioStationModel API
+ */	
+void TestRadioUiEngine::testRadioStationModel()
+{
+	testRadioStationModelInit();
+	testAddStation1();
+	testSaveStation1();
+	testAddStation2();
+	testSaveStation2();
+	testAddStation3();
+	testSaveStation3();
+	testSortByFrequency();
+	testFindPresetIndex();
+	testRemoveByFrequency();
+	testRemoveByPresetIndex();
+	testRemoveStation();
+	testSetFavorite();
+	testRenameStation();
+	testSetRadioTextPlus();
+}
+/*!
+ * Test RadioHistoryModel API
+ */
+void TestRadioUiEngine::testhistoryModel()
+    {
+    testHistoryModelInit();
+    testHistoryModelAddItem();
+    testHistoryModelFindItem();
+    testHistoryModelUpdateItem();
+    testHistoryModelSetData();
+    testAddRadioTextPlus();
+    testClearRadioTextPlus();
+    }
+
+/*!
+ * Testing of RadioHistoryModel initial state
+ */
+void TestRadioUiEngine::testHistoryModelInit()
+{
+    //TODO:: Check why ASSERT fails when mhistoryModel->rowCount() == 0 
+    if( mhistoryModel->rowCount()>0 )
+    {       
+        mhistoryModel->removeAll();
+        QVERIFY2((mRadioStationModel->rowCount()==0), "API:RadioHistoryModel removeAll() 1");
+    }
+    QVERIFY2((mhistoryModel->rowCount()==0), "API:RadioHistoryModel removeAll() 2");           
+}
+
+/*!
+ *
+ */
+void TestRadioUiEngine::testHistoryModelAddItem()
+{
+    int expectedHistoryItemCount( mhistoryModel->rowCount() + 1 );
+    mEnteredSlots = NoSlotsEntered;
+    mhistoryModel->addItem( KTestArtist1, KTestTitle1 );    
+    bool correctSignalsReceived = mEnteredSlots.testFlag( ItemAdded );
+    // check that correct signals received
+    QVERIFY2(correctSignalsReceived, "API:RadioHistoryModel addItem() 1");
+    // check that item count increases
+    QVERIFY2((mhistoryModel->rowCount()==expectedHistoryItemCount), "API:RadioHistoryModel addItem() 2");
+    
+    // check that artist/title stored into the model conforms to the one read from the model
+    QModelIndex index = mhistoryModel->index( 0, 0 );
+    QStringList stringList = mhistoryModel->data( index, Qt::DisplayRole ).value<QStringList>();        
+    QString artistTitle = stringList.at(0);    
+    QVERIFY2(!(artistTitle.compare(KTestArtist1+" - "+KTestTitle1)), "API:RadioHistoryModel addItem() 3");
+    
+    
+    expectedHistoryItemCount = mhistoryModel->rowCount();
+    // trying to add an item that allready exists must not increase the item count
+    mhistoryModel->addItem( KTestArtist1, KTestTitle1 );
+    QVERIFY2((mhistoryModel->rowCount()==expectedHistoryItemCount), "API:RadioHistoryModel addItem() 4");
+}
+
+/*!
+ *
+ */
+void TestRadioUiEngine::testHistoryModelFindItem()
+{
+    RadioHistoryItem item;
+    mhistoryModel->findItem( KTestArtist1, KTestTitle1, item );
+    QVERIFY2((item.artist()==KTestArtist1), "API:RadioHistoryModel findItem() 1");
+    QVERIFY2((item.title()==KTestTitle1), "API:RadioHistoryModel findItem() 2");
+    // try to find an item that doesn't exist
+    int ret = mhistoryModel->findItem( KTestArtist1+"+", KTestTitle1, item );
+    QVERIFY2(ret==-1, "API:RadioHistoryModel findItem() 3");
+}
+
+/*!
+ *
+ */
+void TestRadioUiEngine::testHistoryModelUpdateItem()
+{
+    RadioHistoryItem item;    
+    mhistoryModel->findItem( KTestArtist1, KTestTitle1, item );
+    item.setTitle( KTestTitle2 );    
+    // update an existing item
+    mhistoryModel->updateItem( 0, item, true );
+    
+    RadioHistoryItem foundItem;
+    // original item must not be found any more
+    int ret = mhistoryModel->findItem(KTestArtist1, KTestTitle1, foundItem);
+    QVERIFY2(ret==-1, "API:RadioHistoryModel updateItem() 1");
+    // but the updated one instead
+    mhistoryModel->findItem(KTestArtist1, KTestTitle2, foundItem);
+    QVERIFY2((foundItem.title()==KTestTitle2), "API:RadioHistoryModel updateItem() 2"); 
+}
+
+/*!
+ *
+ */
+void TestRadioUiEngine::testHistoryModelSetData()
+{
+   RadioHistoryItem foundItem;
+   mhistoryModel->findItem(KTestArtist1, KTestTitle2, foundItem);
+   QVERIFY2(!foundItem.isFavorite(), "API:RadioHistoryModel SetData() 1");
+   
+   QModelIndex index = mhistoryModel->index( 0, 0 );
+   QString artistTitle = KTestArtist1 + KTestTitle2;
+   mhistoryModel->setData( index, artistTitle, RadioHistoryModel::SetFavoriteRole );
+   mhistoryModel->findItem(KTestArtist1, KTestTitle2, foundItem);
+   // item should be now favorite
+   QVERIFY2(foundItem.isFavorite(), "API:RadioHistoryModel SetData() 2");    
+}
+
+/*!
+ *
+ */
+void TestRadioUiEngine::testAddRadioTextPlus()
+{   
+    mhistoryModel->addRadioTextPlus( RtPlus::Artist, KTestArtist1 );
+    mhistoryModel->addRadioTextPlus( RtPlus::Title, KTestTitle1 );
+}
+
+/*!
+ *
+ */
+void TestRadioUiEngine::testClearRadioTextPlus()
+{   
+    mhistoryModel->clearRadioTextPlus();
+}
+
+/*!
+ * Test RadioHistoryModelItem API
+ */
+void TestRadioUiEngine::testHistoryModelItem()
+{
+    RadioHistoryItem* item = new RadioHistoryItem( KTestArtist3, KTestTitle3 );
+    item->setArtist( KTestArtist3 );
+    QVERIFY2(!(item->artist().compare(KTestArtist3)), "API:testHistoryModelItem setArtist()");
+    item->setTitle( KTestTitle3 );
+    QVERIFY2(!(item->title().compare(KTestTitle3)), "API:testHistoryModelItem setTitle()");
+    QVERIFY2(!item->isFavorite(), "API:testHistoryModelItem isFavorite() 1");
+    item->setFavorite();
+    QVERIFY2(item->isFavorite(), "API:testHistoryModelItem isFavorite() 2");
+    item->setFavorite();
+    delete item;
+    item = NULL;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiouiengine/tsrc/t_radiouiengine.pro	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: project file for radiouiengine tests
+*
+*/
+
+TEMPLATE = app
+TARGET = t_radiouiengine
+
+
+symbian: {
+    TARGET.CAPABILITY = CAP_GENERAL_DLL
+    TARGET.SID = 0x101FF976 # Old visual radio uid
+}
+
+
+DEPENDPATH += . \
+    inc \
+    src
+INCLUDEPATH += . \
+    /epoc32/include/domain \
+    /epoc32/include/domain/middleware \
+    /epoc32/include/domain/applications \
+    /epoc32/include/osextensions \
+    /epoc32/include/middleware \
+    /epoc32/include/osextensions/stdapis/stlport \
+    stub/inc \
+    ../../../inc \
+    ../inc \
+    ../../commoninc \
+    ../../radioenginewrapper/inc \
+    ../../radiopresetstorage/inc \
+    ../../../../inc
+
+CONFIG += qtestlib
+
+symbian:LIBS += -lradiouiengine
+symbian:LIBS += -lradioenginewrapper
+symbian:LIBS += -lradiopresetstorage
+
+HEADERS += inc/t_radiostation.h
+SOURCES += src/t_radiostation.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/inc/radiobannerlabel.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef RADIOBANNERLABEL_H_
+#define RADIOBANNERLABEL_H_
+
+// System includes
+#include <HbLabel>
+
+// User includes
+#include "radiowidgetsexport.h"
+
+class WIDGETS_DLL_EXPORT RadioBannerLabel : public HbLabel
+{
+    Q_OBJECT
+
+public:
+
+    RadioBannerLabel( QGraphicsItem * parent = 0 );
+
+private:
+
+// from base class QGraphicsItem
+
+    void paint( QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget );
+
+};
+
+#endif // RADIOBANNERLABEL_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/inc/radiofadinglabel.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,62 @@
+/*
+* 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 RADIOFADINGLABEL_H
+#define RADIOFADINGLABEL_H
+
+// System includes
+#include <HbLabel>
+#include <HbEffect>
+
+// User includes
+#include "radiowidgetsexport.h"
+
+class WIDGETS_DLL_EXPORT RadioFadingLabel : public HbLabel //TODO: Derive from HbLineEdit
+{
+    Q_OBJECT
+
+public:
+
+    RadioFadingLabel( QGraphicsItem* parent = 0 );
+
+    void setFadingEnabled( bool fading );
+
+    void setTextWithoutFading( const QString& newText );
+
+public slots:
+
+    void setText( const QString& newText );
+
+private slots:
+
+    void effectFinished( HbEffect::EffectStatus status );
+
+private:
+
+    void startEffect( const QString& effectName, const char* slot = 0 );
+
+    QString trimHtml( const QString& text );
+
+private: // data
+
+    QString     mTextHolder;
+
+    bool        mFadingEnabled;
+
+};
+
+#endif // RADIOFADINGLABEL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/inc/radiofrequencyitem.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,51 @@
+/*
+* 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 RADIOFREQUENCYITEM_H
+#define RADIOFREQUENCYITEM_H
+
+// System includes
+#include <QPixmap>
+
+// Forward declarations
+class RadioFrequencyStrip;
+class QGraphicsPixmapItem;
+
+// Class declaration
+class RadioFrequencyItem
+{
+public:
+
+    RadioFrequencyItem( QString frequency );
+
+    uint frequency() const;
+
+    QPixmap updatePrimitive( QGraphicsPixmapItem* item );
+
+    void setPixmap( QPixmap pixmap );
+
+private: // data
+
+    uint                        mFrequency;
+
+    QPixmap                     mPixmap;
+
+    QGraphicsPixmapItem*        mGraphicsItem;
+
+};
+
+#endif // RADIOFREQUENCYITEM_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/inc/radiofrequencyscanner.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,91 @@
+/*
+* 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 RADIOPRESETSCANNER_H_
+#define RADIOPRESETSCANNER_H_
+
+// System includes
+#include <QObject>
+#include <QScopedPointer>
+
+// Forward declarations
+class HbProgressDialog;
+class RadioStation;
+class RadioUiEngine;
+class RadioWindow;
+class RadioFrequencyStrip;
+class RadioStationCarousel;
+class RadioScannerEngine;
+
+// Class declaration
+class RadioFrequencyScanner : public QObject
+{
+    Q_OBJECT
+
+public:
+
+    RadioFrequencyScanner( RadioUiEngine& uiEngine, QObject* parent );
+    ~RadioFrequencyScanner();
+
+    void startScanning();
+
+    bool isAlive() const;
+
+signals:
+
+    void frequencyScannerFinished();
+
+public slots:
+
+    void cancelScanning();
+
+private slots:
+
+    void delayedStart();
+    void updateScanProgress( const RadioStation& station );
+    void continueScanning();
+    void restoreUiControls();
+
+private:
+
+    void finishScanning();
+
+private: // data
+
+    /*!
+     * Reference to the Ui engine
+     */
+    RadioUiEngine&                      mUiEngine;
+
+    bool                                mInMainView;
+
+    QScopedPointer<RadioScannerEngine>  mScannerEngine;
+
+    /**
+     * Scanning progress note
+     * Own.
+     */
+    QScopedPointer<HbProgressDialog>    mScanningProgressNote;
+
+    int                                 mStripScrollTime;
+    int                                 mCarouselScrollTime;
+
+    bool                                mIsAlive;
+
+};
+
+#endif // RADIOPRESETSCANNER_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/inc/radiofrequencystrip.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,204 @@
+/*
+* 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 FREQUENCYSTRIP_H
+#define FREQUENCYSTRIP_H
+
+// System includes
+#include <QMap>
+#include <QHash>
+#include <HbIcon>
+#include <HbEffect>
+#include <QColor>
+
+// User includes
+#include "radiostripbase.h"
+#include "radio_global.h"
+#include "radiowidgetsexport.h"
+
+// Forward declarations
+class RadioUiEngine;
+class RadioFrequencyItem;
+class RadioStation;
+class HbPushButton;
+class QTimer;
+class QModelIndex;
+
+// Class declaration
+class WIDGETS_DLL_EXPORT RadioFrequencyStrip : public RadioStripBase
+{
+    Q_OBJECT
+    Q_PROPERTY( HbIcon leftButtonIcon READ leftButtonIcon WRITE setLeftButtonIcon )
+    Q_PROPERTY( HbIcon rightButtonIcon READ rightButtonIcon WRITE setRightButtonIcon )
+
+    friend class RadioFrequencyItem;
+
+public:
+
+    RadioFrequencyStrip();
+
+    void setLeftButtonIcon( const HbIcon& leftButtonIcon );
+    HbIcon leftButtonIcon() const;
+
+    void setRightButtonIcon( const HbIcon& rightButtonIcon );
+    HbIcon rightButtonIcon() const;
+
+    void init( RadioUiEngine* engine );
+
+    void setFrequency( const uint frequency, int reason = 0 );
+    uint frequency() const;
+
+public slots:
+
+    void updateFavorite( const RadioStation& station );
+    void setScanningMode( bool isScanning );
+
+signals:
+
+    void frequencyChanged( uint frequency, int reason ); // reason is always CommandSender::RadioFrequencyStrip
+    void skipRequested( int skipMode );
+    void seekRequested( int seekDirection );
+
+private slots:
+
+    void updateStation( const QModelIndex& parent, int first, int last );
+    void initEmptyItems();
+    void handleLeftButton();
+    void handleLongLeftButton();
+    void handleRightButton();
+    void handleLongRightButton();
+    void toggleButtons();
+    void checkIllegalPos();
+
+private:
+
+// from base class RadioStripBase
+
+    void updateItemPrimitive( QGraphicsItem* itemToUpdate, int itemIndex );
+    QGraphicsItem* createItemPrimitive( QGraphicsItem *parent );
+    void scrollPosChanged( QPointF newPosition );
+
+// from base class QGraphicsWidget
+
+    void resizeEvent ( QGraphicsSceneResizeEvent* event );
+    void showEvent( QShowEvent* event );
+    void changeEvent( QEvent* event );
+
+// from base class HbScrollArea
+
+    void mousePressEvent( QGraphicsSceneMouseEvent* event );
+    void mouseReleaseEvent( QGraphicsSceneMouseEvent* event );
+    void gestureEvent( QGestureEvent* event );
+
+// New functions
+
+    void initModel();
+
+    void initSelector();
+
+    void initPositions();
+
+    void initButtons();
+
+    void addFrequencyPos( int pos, uint frequency, RadioFrequencyItem* item );
+
+    void updateFavorites( RadioFrequencyItem* item );
+
+    void updateItems();
+
+    QPixmap drawPixmap( uint frequency, QList<RadioStation> stations, RadioFrequencyItem* item );
+
+    void emitFrequencyChanged( uint frequency );
+
+    int selectorPos() const;
+
+    void scrollToFrequency( uint frequency, int time = 0 );
+
+    void hideButtons();
+    void showButtons();
+
+private: // data
+
+    class FrequencyPos
+    {
+    public:
+        explicit FrequencyPos( int pos, RadioFrequencyItem* item ) :
+            mPosition( pos ),
+            mItem( item ) {}
+
+        FrequencyPos() :
+            mPosition( 0 ),
+            mItem( 0 ) {}
+
+        int                     mPosition;
+        RadioFrequencyItem*     mItem;
+
+    };
+
+    RadioUiEngine*              mUiEngine;
+
+    uint                        mMinFrequency;
+
+    uint                        mMaxFrequency;
+
+    uint                        mFrequencyStepSize;
+
+    uint                        mFrequency;
+
+    QGraphicsPixmapItem*        mSelectorImage;
+
+    qreal                       mSeparatorPos;
+
+    short                       mMaxWidth;
+
+    qreal                       mSelectorPos;
+
+    QList<RadioFrequencyItem*>  mFrequencyItems;
+
+    /**
+     * Container to help map a frequency to strip position and additional information about the frequency.
+     * In the default region contains an item for every valid frequency from 87.50 Mhz to 108.00 Mhz with
+     * stepsize 50 Khz which amounts to 410 items.
+     */
+    QMap<uint,FrequencyPos>     mFrequencies;
+
+    /**
+     * Container to help map strip position to frequency.
+     * It is queried every time the strip moves so the lookup time needs to be fast. QHash is used because
+     * it offers the fastest lookup time of any other QT container. QHash stores the items in arbitrary
+     * order so we must never try to loop through them and assume they are in any particular order.
+     */
+    QHash<int,uint>             mPositions;
+
+    HbIcon                      mLeftButtonIcon;
+
+    HbIcon                      mRightButtonIcon;
+
+    HbPushButton*               mLeftButton;
+
+    HbPushButton*               mRightButton;
+
+    QTimer*                     mButtonTimer;
+    bool                        mButtonsVisible;
+
+    bool                        mUserIsScrolling;
+
+    QColor                      mForegroundColor;
+
+};
+
+#endif // FREQUENCYSTRIP_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/inc/radiohistoryview.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,93 @@
+/*
+* 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 RADIOHISTORYVIEW_H
+#define RADIOHISTORYVIEW_H
+
+// System includes
+#include <HbIcon>
+#include <QScopedPointer>
+
+// User includes
+#include "radioviewbase.h"
+#include "radiowidgetsexport.h"
+
+// Forward declarations
+class RadioXmlUiLoader;
+class HbListView;
+class HbAction;
+class HbAbstractViewItem;
+class RadioHistoryModel;
+class RadioHistoryItem;
+
+// Class declaration
+class WIDGETS_DLL_EXPORT RadioHistoryView : public RadioViewBase
+{
+    Q_OBJECT
+    Q_PROPERTY(HbIcon nonTaggedIcon READ nonTaggedIcon WRITE setNonTaggedIcon)
+    Q_PROPERTY(HbIcon taggedIcon READ taggedIcon WRITE setTaggedIcon)
+
+public:
+
+    RadioHistoryView();
+    ~RadioHistoryView();
+
+    void setNonTaggedIcon( const HbIcon& nonTaggedIcon );
+    HbIcon nonTaggedIcon() const;
+
+    void setTaggedIcon( const HbIcon& taggedIcon );
+    HbIcon taggedIcon() const;
+
+private slots:
+
+    void deckButtonPressed();
+    void clearList();
+    void updateVisibilities();
+    void showContextMenu( const QModelIndex& index );
+    void toggleTagging();
+    void openOviStore();
+    void openOtherStore();
+    void addSongs();            // Temporary test code
+    void addOneSong();          // Temporary test code
+
+private:
+
+// from base class RadioViewBase
+
+    void init();
+    void setOrientation();
+    void userAccepted();
+
+// New functions
+
+    RadioHistoryModel& historyModel() const;
+
+private: //data
+
+    HbListView*                         mHistoryList;
+    HbAction*                           mAllSongsButton;
+    HbAction*                           mTaggedSongsButton;
+    QScopedPointer<RadioHistoryItem>    mSelectedItem;
+    int                                 mCurrentRow;
+    HbIcon                              mNonTaggedIcon;
+    HbIcon                              mTaggedIcon;
+
+    int                                 mSongIndex; // Temporary test variable
+
+};
+
+#endif // RADIOHISTORYVIEW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/inc/radiomainview.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef RADIOMAINVIEW_H
+#define RADIOMAINVIEW_H
+
+// System includes
+#include <QScopedPointer>
+
+// User includes
+#include "radioviewbase.h"
+#include "radiowidgetsexport.h"
+
+// Forward declarations
+class RadioWindow;
+class RadioStationModel;
+class HbPushButton;
+class RadioUiLoader;
+class RadioFrequencyScanner;
+class RadioStationCarousel;
+class RadioFrequencyStrip;
+
+// Class declaration
+class WIDGETS_DLL_EXPORT RadioMainView : public RadioViewBase
+    {
+    Q_OBJECT
+
+public:
+
+    explicit RadioMainView();
+    ~RadioMainView();
+
+    void setScanningMode( bool scanning );
+
+private slots:
+
+    void setFrequencyFromWidget( uint frequency, int reason );
+    void setFrequencyFromEngine( uint frequency, int reason );
+    void skip( int skipMode );
+    void toggleScanning();
+    void seekingStarted();
+    void updateAudioRoute( bool loudspeaker );
+
+private:
+
+// from base class RadioViewBase
+
+    void init();
+    void setOrientation();
+    void userAccepted();
+
+private: // data
+
+    QScopedPointer<RadioFrequencyScanner>   mFrequencyScanner;
+    RadioStationCarousel*                   mCarousel;
+    RadioFrequencyStrip*                    mFrequencyStrip;
+
+    };
+
+#endif // RADIOMAINVIEW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/inc/radiostationcarousel.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,226 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef RADIOSTATIONCAROUSEL_H
+#define RADIOSTATIONCAROUSEL_H
+
+// System includes
+#include <HbGridView>
+#include <QMap>
+#include <QAbstractItemModel>
+#include <HbIcon>
+
+// User includes
+#include "radiowidgetsexport.h"
+#include "radio_global.h"
+
+// Forward declarations
+class RadioUiEngine;
+class RadioUiLoader;
+class RadioStation;
+class RadioStationItem;
+class RadioStationCarousel;
+class RadioCarouselModel;
+class RadioFadingLabel;
+class QTimeLine;
+class HbLabel;
+
+namespace CarouselInfoText
+{
+    enum Type
+    {
+        None,
+        ConnectAntenna,
+        NoFavorites,
+        Seeking,
+        Scanning
+    };
+}
+
+// Class declaration
+class ScanningHelper : public QObject
+{
+    Q_OBJECT
+
+public:
+
+    ScanningHelper( RadioStationCarousel& carousel );
+
+    void start();
+
+private slots:
+
+    void startSlide();
+    void startNumberScroll();
+    void numberScrollUpdate( int value );
+
+public:
+
+    RadioStationCarousel&   mCarousel;
+    uint                    mCurrentFrequency;
+    uint                    mPreviousFrequency;
+    RadioStationItem*       mStationItem;
+    QTimeLine*              mNumberScrollingTimeLine;
+    QModelIndex             mModelIndex;
+
+};
+
+// Class declaration
+class WIDGETS_DLL_EXPORT RadioStationCarousel : public HbGridView
+{
+    Q_OBJECT
+    Q_PROPERTY(HbIcon favoriteIcon READ favoriteIcon WRITE setFavoriteIcon)
+    Q_PROPERTY(HbIcon nonFavoriteIcon READ nonFavoriteIcon WRITE setNonFavoriteIcon)
+    Q_PROPERTY( int autoScrollTime READ autoScrollTime WRITE setAutoScrollTime )
+
+    friend class ScanningHelper;
+
+public:
+
+    enum ScrollFlag
+    {
+        Default         = 0,
+        NoAnim          = 1 << 0,
+        NoSignal        = 1 << 1,
+        UpdateItem      = 1 << 2
+    };
+    Q_DECLARE_FLAGS( ScrollMode, ScrollFlag )
+
+    RadioStationCarousel( RadioUiEngine* uiEngine = 0 );
+
+    void setFavoriteIcon( const HbIcon& favoriteIcon );
+    HbIcon favoriteIcon() const;
+
+    void setNonFavoriteIcon( const HbIcon& nonFavoriteIcon );
+    HbIcon nonFavoriteIcon() const;
+
+    void setAutoScrollTime( const int time );
+    int autoScrollTime() const;
+
+    void init( RadioUiLoader& uiLoader, RadioUiEngine* uiEngine );
+
+    void setCarouselModel( RadioCarouselModel* carouselModel );
+
+    void setFrequency( uint frequency, int reason );
+
+    RadioUiEngine* uiEngine();
+
+    bool isAntennaAttached() const;
+
+    void setScanningMode( bool scanning );
+    bool isInScanningMode() const;
+
+    void cleanRdsData();
+
+    void updateCurrentItem();
+
+    void animateNewStation( const RadioStation& station );
+
+    void setItemVisible( bool visible );
+
+    void setInfoText( CarouselInfoText::Type type );
+    void clearInfoText();
+
+signals:
+
+    void frequencyChanged( uint frequency, int reason );
+    void scanAnimationFinished();
+
+public slots:
+
+    void updateAntennaStatus( bool connected );
+
+private slots:
+
+    void update( const RadioStation& station );
+    void updateRadioText( const RadioStation& station );
+    void insertFrequency( const QModelIndex& parent, int first, int last );
+    void prepareToRemoveFrequency( const QModelIndex& parent, int first, int last );
+    void removeFrequency( const QModelIndex& parent, int first, int last );
+    void updateFrequencies();
+    void timerFired();
+    void openContextMenu( HbAbstractViewItem* item, const QPointF& coords );
+
+#ifdef USE_DEBUGGING_CONTROLS
+    void setRdsAvailable( bool available );
+#endif // USE_DEBUGGING_CONTROLS
+
+private:
+
+// from base class QGraphicsItem
+
+    void mousePressEvent( QGraphicsSceneMouseEvent* event );
+
+    void gestureEvent( QGestureEvent* event );
+
+// New functions
+
+    void initToLastTunedFrequency();
+
+    void updateClampingStyle();
+
+    void initCurrentStationItem();
+
+    RadioStationItem* currentStationItem();
+
+    RadioCarouselModel* carouselModel() const;
+
+    void scrollToIndex( const QModelIndex& index, ScrollMode mode = Default );
+
+    void updatePos( int offset );
+
+    void skip( StationSkip::Mode mode );
+
+private: // data
+
+    enum TimerMode { NoTimer, RtPlusCheck, InfoText };
+
+    RadioUiEngine*          mUiEngine;
+
+    bool                    mAntennaAttached;
+
+    int                     mAutoScrollTime;
+
+    QMap<uint,QModelIndex>  mModelIndexes;
+
+    HbIcon                  mFavoriteIcon;
+    HbIcon                  mNonFavoriteIcon;
+
+    QTimer*                 mGenericTimer;
+    TimerMode               mTimerMode;
+
+    QString                 mRadioTextHolder;
+
+    ScanningHelper*         mScanningHelper;
+
+    HbLabel*                mInfoText;
+
+    RadioStationItem*       mCurrentItem;
+
+    CarouselInfoText::Type  mInfoTextType;
+
+    int                     mPanStartPos;
+	
+#ifdef USE_DEBUGGING_CONTROLS
+    RadioFadingLabel*       mRdsLabel;
+#endif
+
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS( RadioStationCarousel::ScrollMode )
+
+#endif // RADIOSTATIONCAROUSEL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/inc/radiostationitem.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,80 @@
+/*
+* 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 RADIOSTATIONITEM_H
+#define RADIOSTATIONITEM_H
+
+// System includes
+#include <HbAbstractViewItem>
+
+// Forward declarations
+class RadioFadingLabel;
+class HbPushButton;
+class RadioStation;
+class HbAnchorLayout;
+class RadioStationCarousel;
+
+// Class declaration
+class RadioStationItem : public HbAbstractViewItem
+{
+    Q_OBJECT
+    friend class RadioStationCarousel;
+
+public:
+
+    RadioStationItem( RadioStationCarousel& carousel );
+
+// From base class HbAbstractViewItem
+
+    HbAbstractViewItem* createItem();
+    void updateChildItems();
+
+// New functions
+
+    uint frequency() const;
+    void update( const RadioStation* station = 0 );
+    void setFrequency( uint frequency );
+    void cleanRdsData();
+    void handleLongPress( const QPointF& coords );
+
+private slots:
+
+    void toggleFavorite();
+
+private:
+
+    void updateFavoriteIcon( bool isFavorite );
+
+    RadioStationCarousel* carousel();
+
+    QString parseFrequency( const uint frequency );
+    QString nameOrFrequency( const RadioStation& station, uint frequency = 0 );
+
+private: // data
+
+    RadioStationCarousel&   mCarousel;
+    HbAnchorLayout*         mLayout;
+    RadioFadingLabel*       mNameLabel;
+    HbPushButton*           mIconButton;
+    RadioFadingLabel*       mGenreLabel;
+    RadioFadingLabel*       mRadiotextLabel;
+    RadioFadingLabel*       mUrlLabel;
+    uint                    mFrequency;
+};
+
+
+#endif // RADIOSTATIONITEM_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/inc/radiostationsview.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,118 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef RADIOSTATIONSVIEW_H
+#define RADIOSTATIONSVIEW_H
+
+// System includes
+#include <HbIcon>
+#include <QScopedPointer>
+
+// User includes
+#include "radioviewbase.h"
+#include "radiowidgetsexport.h"
+
+// Forward declarations
+class RadioWindow;
+class RadioStationModel;
+class HbListView;
+class HbPushButton;
+class RadioBannerLabel;
+class HbAbstractViewItem;
+class RadioUiLoader;
+class RadioStation;
+class RadioStationFilterModel;
+class RadioFrequencyScanner;
+
+// Class declaration
+class WIDGETS_DLL_EXPORT RadioStationsView : public RadioViewBase
+{
+    Q_OBJECT
+    Q_PROPERTY(HbIcon nowPlayingIcon READ nowPlayingIcon WRITE setNowPlayingIcon)
+    Q_PROPERTY(HbIcon favoriteIcon READ favoriteIcon WRITE setFavoriteIcon)
+
+public:
+
+    explicit RadioStationsView();
+    ~RadioStationsView();
+
+    void setNowPlayingIcon( const HbIcon& nowPlayingIcon );
+    HbIcon nowPlayingIcon() const;
+
+    void setFavoriteIcon( const HbIcon& favoriteIcon );
+    HbIcon favoriteIcon() const;
+
+private slots:
+
+    void listItemClicked( const QModelIndex& index );
+    void listItemLongPressed( HbAbstractViewItem* item, const QPointF& coords );
+    void updateAntennaStatus( bool connected );
+    void updateCurrentStation();
+    void deckButtonPressed();
+    void startScanning();
+    void finishScanning();
+    void updateControlVisibilities();
+    void clearList();
+    void rename();          // Called from context menu
+    void toggleFavorite();  // Called from context menu
+    void deleteStation();   // Called from context menu
+    void renameDone( HbAction* action );
+
+private:
+
+// from base class RadioViewBase
+
+    void init();
+    void userAccepted();
+
+// from base class QGraphicsWidget
+
+    void showEvent( QShowEvent* event );
+
+// New functions
+
+    void initListView();
+
+private: //data
+
+    RadioStationModel*                      mModel;
+
+    RadioStationFilterModel*                mFilterModel;
+
+    HbAction*                               mScanStationsAction;
+    HbAction*                               mClearListAction;
+
+    HbListView*                             mStationsList;
+
+    RadioBannerLabel*                       mHeadingBanner;
+
+    HbAction*                               mFavoritesButton;
+    HbAction*                               mLocalStationsButton;
+
+    HbIcon                                  mFavoriteIcon;
+    HbIcon                                  mNowPlayingIcon;
+
+    QScopedPointer<RadioStation>            mSelectedStation;
+
+    QScopedPointer<RadioFrequencyScanner>   mFrequencyScanner;
+
+    enum UserQuestion { NoQuestion, DeleteStation, StartScanning, ClearList };
+    UserQuestion                            mCurrentQuestion;
+
+};
+
+#endif // RADIOSTATIONSVIEW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/inc/radiostripbase.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,126 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef RADIOSTRIPBASE_H_
+#define RADIOSTRIPBASE_H_
+
+// System includes
+#include <HbScrollArea>
+
+// Forward declarations
+class HbWidget;
+class QAbstractItemModel;
+
+// Class declaration
+class RadioStripBase : public HbScrollArea
+{
+    Q_OBJECT
+    Q_PROPERTY( int autoScrollTime READ autoScrollTime WRITE setAutoScrollTime )
+
+public:
+
+    virtual ~RadioStripBase();
+
+    void setAutoScrollTime( const int time );
+    int autoScrollTime() const;
+
+    void setModel( QAbstractItemModel* model );
+    QAbstractItemModel* model() const;
+
+    void setCyclic( bool isCyclic );
+    void setSpacing( qreal spacing );
+    void setAutoCenter( bool autoCenter );
+    void setItemSize( const QSizeF& size );
+    void setIndex( int index, bool animateToCenter );
+
+protected:
+
+    RadioStripBase( QGraphicsItem* parent = 0 );
+
+// from base class QGraphicsWidget
+
+    void resizeEvent( QGraphicsSceneResizeEvent* event );
+
+// from base class QGraphicsItem
+
+    void mousePressEvent( QGraphicsSceneMouseEvent* event );
+    void mouseReleaseEvent( QGraphicsSceneMouseEvent* event );
+
+private slots:
+
+    void scrollPositionChanged( QPointF newPosition );
+
+private:
+
+    Q_DISABLE_COPY( RadioStripBase )
+
+    virtual void updateItemPrimitive( QGraphicsItem* itemToUpdate, int itemIndex ) = 0;
+    virtual QGraphicsItem* createItemPrimitive( QGraphicsItem *parent ) = 0;
+
+    virtual void scrollPosChanged( QPointF newPosition ) = 0;
+
+    void moveAllItemsToPool();
+
+    void populateAndLayout();
+
+    QGraphicsItem* constructItem( int index, bool append );
+
+    QGraphicsItem* getFromPool();
+
+    void returnToPool( QGraphicsItem* item );
+
+    qreal indexToOffset( int index );
+
+    int offsetToIndex( qreal offset );
+
+    void updateItemWithIndex( int index );
+
+    void adjustItems();
+
+protected: // data
+
+    int                     mAutoScrollTime;
+
+private: //data
+
+    HbWidget*               mStripContainer;
+
+    QAbstractItemModel*     mModel;
+
+    bool                    mIsCyclic;
+    bool                    mAutoCenter;
+
+    qreal                   mSpacing;
+
+    QSizeF                  mItemSize;
+
+    QList<QGraphicsItem*>   mItemPool;
+    QGraphicsWidget*        mItemPoolParent;
+
+    int                     mCurrentIndex;
+    int                     mPressedIndex;
+
+    qreal                   mStripLength;
+    qreal                   mContentsLength;
+
+    QList<QGraphicsItem*>   mItemAtSlot;
+    QList<int>              mIndexAtSlot; // Can be bigger than rowcount if cyclic is used
+
+};
+
+
+#endif // RADIOSTRIPBASE_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/inc/radiouiloader.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,129 @@
+/*
+* 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 RADIOUILOADER_H_
+#define RADIOUILOADER_H_
+
+// System includes
+#include <HbDocumentLoader>
+
+// Constants
+
+namespace DOCML
+{
+    static QString FILE_MAINVIEW                    = ":/layout/mainview.docml";
+    static QString FILE_STATIONSVIEW                = ":/layout/stationsview.docml";
+    static QString FILE_HISTORYVIEW                 = ":/layout/historyview.docml";
+
+    // Generic XML UI definitions
+    static QString NAME_VIEW                        = "view";
+    static QString SECTION_PORTRAIT                 = "portrait";
+    static QString SECTION_LANDSCAPE                = "landscape";
+    static QString NAME_LOUDSPEAKER_ACTION          = "loudspeaker_action";
+
+    // RadioMainView
+    static QString MV_NAME_HISTORYVIEW_ACTION       = "mv:historyview_action";
+    static QString MV_NAME_STATION_CAROUSEL         = "mv:station_carousel";
+    static QString MV_NAME_FREQUENCY_STRIP          = "mv:frequency_strip";
+    static QString MV_NAME_STATIONS_BUTTON          = "mv:stations_button";
+    static QString MV_NAME_SCAN_BUTTON              = "mv:scan_button";
+    static QString MV_NAME_SPEAKER_BUTTON           = "mv:loudspeaker_button";
+    static QString MV_SECTION_NO_ANTENNA            = "mv:no_antenna";
+    static QString MV_SECTION_SEEKING               = "mv:seeking";
+    static QString MV_SECTION_SCANNING              = "mv:scanning";
+    static QString MV_SECTION_NO_FAVORITES          = "mv:no_favorites";
+    static QString MV_SECTION_NORMAL                = "mv:normal";
+
+    // RadioStationsView
+    static QString SV_NAME_HEADING_BANNER           = "sv:heading_banner";
+    static QString SV_NAME_STATIONS_LIST            = "sv:stations_list";
+    static QString SV_NAME_FAVORITES_BUTTON         = "sv:favorite_stations_button";
+    static QString SV_NAME_LOCALS_BUTTON            = "sv:local_stations_button";
+    static QString SV_NAME_SCAN_ACTION              = "sv:scan_action";
+    static QString SV_NAME_CLEAR_LIST_ACTION        = "sv:clear_list_action";
+    static QString SV_NAME_SCAN_BUTTON              = "sv:scan_button";
+
+    static QString SV_SECTION_SHOW_ALL_STATIONS     = "show_all_stations";
+    static QString SV_SECTION_SHOW_FAVORITES        = "show_favorites";
+    static QString SV_SECTION_SHOW_SCAN_TEXT        = "show_scan_text";
+    static QString SV_SECTION_HIDE_SCAN_TEXT        = "hide_scan_text";
+
+    // RadioStationsView Context Menu
+    static QString NAME_CONTEXT_MENU                = "sv:context_menu";
+    static QString NAME_CONTEXT_RENAME              = "sv:rename_action";
+    static QString NAME_CONTEXT_FAVORITE            = "sv:toggle_favorite_action";
+    static QString NAME_CONTEXT_DELETE              = "sv:delete_action";
+    static QString NAME_INPUT_QUERY                 = "sv:station_name_query";
+
+    // Station Carousel
+    static QString MV_NAME_INFO_FIRST_ROW           = "mv:InfoFirstRow";
+    static QString MV_NAME_INFO_SECOND_ROW          = "mv:InfoSecondRow";
+    static QString MV_NAME_INFO_THIRD_ROW           = "mv:InfoThirdRow";
+    static QString MV_NAME_INFO_FOURTH_ROW          = "mv:InfoFourthRow";
+    static QString MV_NAME_INFO_TEXT                = "mv:info_text";
+
+    // History View
+    static QString HV_NAME_CLEAR_LIST_ACTION        = "hv:clear_list_action";
+    static QString HV_NAME_HISTORY_LIST             = "hv:history_list";
+    static QString HV_NAME_ALL_SONGS_BUTTON         = "hv:all_songs_button";
+    static QString HV_NAME_TAGGED_SONGS_BUTTON      = "hv:tagged_songs_button";
+    static QString HV_SECTION_SHOW_LIST             = "hv:show_list";
+    static QString HV_SECTION_HIDE_LIST             = "hv:hide_list";
+    static QString HV_SECTION_HISTORY_MODE          = "hv:history_mode";
+    static QString HV_SECTION_FAVORITE_MODE         = "hv:tagged_mode";
+    static QString HV_NAME_CONTEXT_MENU             = "hv:context_menu";
+
+    // History View Context Menu
+    static QString HV_NAME_CONTEXT_TAG              = "hv:toggle_tag_action";
+    static QString HV_NAME_CONTEXT_SEARCH           = "hv:search_from_other_store_action";
+
+}
+
+// Class declaration
+class RadioUiLoader : public HbDocumentLoader
+{
+public:
+
+    RadioUiLoader();
+
+    /*!
+     * Returns the requested widget casted to correct type
+     *
+     * @param name Name of the widget
+     * @return Pointer to the widget
+     */
+    template<class T>
+    T* findWidget( QString name )
+    {
+        return qobject_cast<T*>( HbDocumentLoader::findWidget( name ) );
+    }
+
+    /*!
+     * Returns the requested object casted to correct type
+     *
+     * @param name Name of the object
+     * @return Pointer to the object
+     */
+    template<class T>
+    T* findObject( QString name )
+    {
+        return qobject_cast<T*>( HbDocumentLoader::findObject( name ) );
+    }
+
+};
+
+#endif // RADIOUILOADER_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/inc/radiouiutilities.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef _RADIOUIUTILITIES_H_
+#define _RADIOUIUTILITIES_H_
+
+// System includes
+#include <QPointer>
+
+// Forward declarations
+class RadioFrequencyStrip;
+class RadioStationCarousel;
+class RadioFrequencyScanner;
+
+struct EffectInfo
+{
+    EffectInfo( QGraphicsItem* item, QString path, QString event ) :
+        mItem( item ),
+        mPath( path ),
+        mEvent( event )
+    {}
+
+    QGraphicsItem* mItem;
+    QString mPath;
+    QString mEvent;
+
+private:
+    EffectInfo();
+};
+typedef QList<EffectInfo> QEffectList;
+
+// Class declaration
+class RadioUiUtilities
+{
+public:
+
+    static bool addEffects( QEffectList list );
+
+    static RadioFrequencyStrip* frequencyStrip();
+    static RadioStationCarousel* carousel();
+    static bool isScannerAlive();
+
+    static void setFrequencyStrip( RadioFrequencyStrip* frequencyStrip );
+    static void setCarousel( RadioStationCarousel* carousel );
+    static void setFrequencyScanner( RadioFrequencyScanner* scanner );
+
+private:
+
+    RadioUiUtilities();
+    ~RadioUiUtilities();
+
+    static RadioUiUtilities& instance();
+
+private: // data
+
+    QPointer<RadioFrequencyStrip>   mFrequencyStrip;
+
+    QPointer<RadioStationCarousel>  mCarousel;
+
+    QPointer<RadioFrequencyScanner> mScanner;
+
+};
+
+
+#endif // _RADIOUIUTILITIES_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/inc/radioviewbase.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,130 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef _RADIOVIEWBASE_H_
+#define _RADIOVIEWBASE_H_
+
+// System includes
+#include <HbView>
+
+#include <QScopedPointer>
+
+// User includes
+
+// Forward declarations
+class RadioWindow;
+class RadioStationModel;
+class RadioUiLoader;
+class HbAction;
+
+// Constants
+namespace MenuItem
+{
+    enum CommonMenuItem
+    {
+        UseLoudspeaker
+    };
+}
+
+// Class declaration
+class RadioViewBase : public HbView
+{
+    Q_OBJECT
+    Q_DISABLE_COPY( RadioViewBase )
+
+public:
+    explicit RadioViewBase( bool transient = true );
+
+    virtual ~RadioViewBase();
+
+    void setMembers( RadioUiLoader* uiLoader, RadioWindow* mainWindow );
+
+    virtual void init() = 0;
+
+    bool isInitialized() const;
+
+    bool isTransient() const;
+
+    void updateOrientation( Qt::Orientation orientation, bool forceUpdate = false );
+
+protected slots:
+
+    void updateAudioRouting( bool loudspeaker );
+    void activatePreviousView();
+    void quit();
+
+private slots:
+
+    void handleUserAnswer( HbAction* answer );   // Needed by HbMessageBox inconvenience API
+
+protected:
+
+// New functinos
+
+    void initBackAction();
+    
+    void connectCommonMenuItem( int menuItem );
+
+    void connectXmlElement( const char* name, const char* signal, QObject* receiver, const char* slot );
+
+    void connectViewChangeMenuItem( QString name, const char* slot );
+
+    void loadSection( const QString& docml, const QString& section );
+
+    void askQuestion( const QString& question );
+
+private:
+
+    virtual void setOrientation();
+    virtual void userAccepted();
+
+protected: // data
+
+    /**
+     * Pointer to the main window.
+     * Not own.
+     */
+    RadioWindow*                        mMainWindow;
+
+    /**
+     * Pointer to the XML UI (DocML) loader
+     * Own.
+     */
+    QScopedPointer<RadioUiLoader>       mUiLoader;
+
+    bool                                mInitialized;
+
+    /**
+     * Flag indicating whether or not the view is transient
+     * Transient views are deleted when they are hidden.
+     */
+    bool                                mTransientView;
+
+    /**
+     * Route audio to Loudspeaker/Headset menu item
+     */
+    HbAction*                           mUseLoudspeakerAction;
+
+    /**
+     * View orientation.
+     */
+    Qt::Orientation                     mOrientation;
+
+};
+
+
+#endif // _RADIOVIEWBASE_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/inc/radiowidgetsexport.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef RADIO_WIDGETS_EXPORT_H_
+#define RADIO_WIDGETS_EXPORT_H_
+
+// System includes
+#include <QtGlobal>
+
+#ifdef BUILD_WIDGETS_DLL
+    #define WIDGETS_DLL_EXPORT Q_DECL_EXPORT
+#else
+    #define WIDGETS_DLL_EXPORT Q_DECL_IMPORT
+#endif
+
+#endif // RADIO_WIDGETS_EXPORT_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/inc/radiowindow.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,120 @@
+/*
+* 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 _RADIOWINDOW_H_
+#define _RADIOWINDOW_H_
+
+// System includes
+#include <HbMainWindow>
+#include <HbEffect>
+#include <QPointer>
+#include <QScopedPointer>
+
+// User includes
+#include "radiowidgetsexport.h"
+
+// Forward declarations
+class RadioViewBase;
+class RadioUiEngine;
+class HbVolumeSliderPopup;
+
+typedef QScopedPointer<HbVolumeSliderPopup> VolumeSliderPtr;
+
+/**
+ * QPointer is used to store the views because it tracks the deletion of the object and nulls
+ * the reference. Transient view like RadioHistoryView is destroyed after they are closed
+ * and QPointer will notice it.
+ */
+typedef QPointer<RadioViewBase> ViewPtr;
+
+// Class declaration
+class WIDGETS_DLL_EXPORT RadioWindow : public HbMainWindow
+{
+    Q_OBJECT
+    Q_DISABLE_COPY( RadioWindow )
+
+public:
+
+    RadioWindow( QWidget *parent = 0 );
+
+    ~RadioWindow();
+
+    void showErrorMessage( const QString& text );
+
+    void init();
+
+    RadioUiEngine& uiEngine();
+
+    QString orientationSection();
+
+public slots:
+
+    void activateMainView();
+
+    void activateStationsView();
+
+    void activateHistoryView();
+
+private slots:
+
+    void initView();
+    void updateOrientation( Qt::Orientation orientation );
+    void showVolumeLevel( int volume );
+    void updateAntennaStatus( bool connected );
+
+private:
+
+// New functions
+
+    void activateView( ViewPtr& aMember, const QString& docmlFile, Hb::ViewSwitchFlags flags = Hb::ViewSwitchDefault );
+
+private: // data
+
+    /*!
+     * Pointer to the UI engine
+     * Own
+     */
+    QScopedPointer<RadioUiEngine>   mUiEngine;
+
+    /**
+     * Tuning view.
+     * Own.
+     */
+    ViewPtr                         mMainView;
+
+    /**
+     * Stations view
+     * Own.
+     */
+    ViewPtr                         mStationsView;
+
+    /**
+     * Play history view
+     * Own.
+     */
+    ViewPtr                         mHistoryView;
+
+    /**
+     * Pointer to the volume slider
+     * Own.
+     */
+    VolumeSliderPtr                 mVolSlider;
+
+};
+
+
+#endif // _RADIOWINDOW_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/radiowidgets.pro	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,68 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+include(../buildflags.pri)
+
+TEMPLATE    = lib
+TARGET      = radiowidgets
+CONFIG      += dll hb
+DEFINES     += BUILD_WIDGETS_DLL
+
+INCLUDEPATH += inc
+INCLUDEPATH += ../radiouiengine/inc
+INCLUDEPATH += ../commoninc
+
+LIBS        += -lradiouiengine
+
+LOGGING_ENABLED:LIBS += -lradioenginewrapper
+
+DEPENDPATH  += $$INCLUDEPATH src
+
+# Input
+HEADERS     += radiowidgetsexport.h
+HEADERS     += radiowindow.h
+HEADERS     += radiouiutilities.h
+HEADERS     += radioviewbase.h
+HEADERS     += radiouiloader.h
+HEADERS     += radiomainview.h
+HEADERS     += radiostripbase.h
+HEADERS     += radiofrequencystrip.h
+HEADERS     += radiofrequencyitem.h
+HEADERS     += radiostationsview.h
+HEADERS     += radiobannerlabel.h
+HEADERS     += radiofrequencyscanner.h
+HEADERS     += radiofadinglabel.h
+HEADERS     += radiostationcarousel.h
+HEADERS     += radiostationitem.h
+HEADERS     += radiohistoryview.h
+
+SOURCES     += radiowindow.cpp
+SOURCES     += radiouiutilities.cpp
+SOURCES     += radioviewbase.cpp
+SOURCES     += radiouiloader.cpp
+SOURCES     += radiomainview.cpp
+SOURCES     += radiostripbase.cpp
+SOURCES     += radiofrequencystrip.cpp
+SOURCES     += radiofrequencyitem.cpp
+SOURCES     += radiostationsview.cpp
+SOURCES     += radiobannerlabel.cpp
+SOURCES     += radiofrequencyscanner.cpp
+SOURCES     += radiofadinglabel.cpp
+SOURCES     += radiostationcarousel.cpp
+SOURCES     += radiostationitem.cpp
+SOURCES     += radiohistoryview.cpp
+
+RESOURCES   += res/fmradioui.qrc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/res/effects/blink_in_out_in.fxml	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,12 @@
+<!-- flip and change opacity -->
+
+<layers> 
+ 	<visual>
+ 		<param name="opacity" type="anim">
+    		<duration>1.0</duration>
+    		<style>easeinout</style>
+            <keyframe at="0.0">0.3</keyframe>
+	        <keyframe at="1.0">1.0</keyframe>            
+        </param>                
+  	</visual>
+</layers>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/res/effects/fade_in.fxml	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,10 @@
+<layers>
+    <visual src="Item">
+        <param name="opacity" type="anim">
+            <duration>1.0</duration>
+            <style>inquad</style>
+            <keyframe at="0.0">0.0</keyframe>
+            <keyframe at="1.0">1.0</keyframe>            
+        </param>
+    </visual>
+</layers>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/res/effects/fade_out.fxml	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,10 @@
+<layers>
+    <visual src="Item">
+        <param name="opacity" type="anim">
+            <duration>1.0</duration>
+            <style>outquad</style>
+            <keyframe at="0.0">1.0</keyframe>
+            <keyframe at="1.0">0.0</keyframe>            
+        </param>
+    </visual>
+</layers>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/res/effects/slide_from_left.fxml	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,9 @@
+<layers>
+  <visual>
+    <param name="scale_x" type="anim"><keyframe
+          at="0">0.0</keyframe><duration>0.3</duration><keyframe
+          at="1.0">1.0</keyframe><style>outback</style></param>
+    <param name="scale_origin_x" ref="visual.width">0.0</param>
+    <param name="scale_origin_y" ref="visual.height">0.0</param>
+  </visual>
+</layers>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/res/effects/slide_from_right.fxml	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,12 @@
+<layers>
+  <visual>
+    <param name="scale_x" type="anim">
+        <duration>0.3</duration>
+        <style>outback</style>
+        <keyframe at="0.0">0.0</keyframe>
+        <keyframe at="0.5">0.5</keyframe>
+        <keyframe at="1.0">1.0</keyframe>
+    </param>
+    <param name="scale_origin_x" ref="visual.right">1</param>
+  </visual>
+</layers>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/res/effects/slide_to_left.fxml	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,9 @@
+<layers>
+  <visual>
+    <param name="scale_x" type="anim"><keyframe
+          at="0">1.0</keyframe><duration>0.3</duration><keyframe
+          at="1.0">0.0</keyframe><style>outquad</style></param>
+    <param name="scale_origin_x" ref="visual.width">0.0</param>
+    <param name="scale_origin_y" ref="visual.height">0.0</param>
+  </visual>
+</layers>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/res/effects/slide_to_right.fxml	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,12 @@
+<layers>
+  <visual>
+    <param name="scale_x" type="anim">
+        <duration>0.3</duration>
+        <style>outquad</style>
+        <keyframe at="0.0">1.0</keyframe>
+        <keyframe at="0.5">0.5</keyframe>
+        <keyframe at="1.0">0.0</keyframe>
+    </param>
+    <param name="scale_origin_x" ref="visual.right">1</param>
+  </visual>
+</layers>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/res/fmradioui.qrc	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<RCC>
+    <qresource>
+        <file>layout/mainview.docml</file>
+        <file>layout/stationsview.docml</file>
+        <file>layout/historyview.docml</file>
+        <file>layout/radiostationitem.css</file>
+        <file>layout/radiostationitem.widgetml</file>
+    </qresource>
+
+    <qresource>
+        <file>effects/blink_in_out_in.fxml</file>
+        <file>effects/fade_out.fxml</file>
+        <file>effects/fade_in.fxml</file>
+        <file>effects/slide_to_left.fxml</file>
+        <file>effects/slide_from_left.fxml</file>
+        <file>effects/slide_to_right.fxml</file>
+        <file>effects/slide_from_right.fxml</file>
+    </qresource>
+    
+    <qresource>
+        <file>images/stripbackground.png</file>
+        <file>images/setfavoriteicon.png</file>
+        <file>images/nowplayingicon.png</file>
+        <file>images/qtg_mono_previous.svg</file>
+        <file>images/qtg_mono_next.svg</file>
+        <file>images/qtg_mono_radio_stations.svg</file>
+        <file>images/qtg_mono_station_scan.svg</file>        
+        <file>images/qtg_mono_speaker.svg</file>
+        <file>images/qtg_mono_speaker_off.svg</file>        
+        <file>images/pri_small_shazam.svg</file>
+        <file>images/qtg_mono_play_history.svg</file>
+        <file>images/pri_small_star.svg</file>
+        <file>images/pri_small_star_inactive.svg</file>
+        <file>images/qtg_fr_lcd.svg</file>
+        <file>images/qtg_fr_lcd_overlay.svg</file>
+        <file>images/qtg_fr_tuner.svg</file>
+        <file>images/qtg_mono_tag.svg</file>
+        <file>images/pri_small_tag.svg</file>
+    </qresource>
+    
+</RCC>
Binary file radioapp/radiowidgets/res/images/nowplayingicon.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/res/images/pri_small_shazam.svg	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
+	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
+]>
+<svg version="1.1"
+	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
+	 x="0px" y="0px" width="30px" height="30px" viewBox="0 0 30 30" enable-background="new 0 0 30 30" xml:space="preserve">
+<defs>
+</defs>
+<path opacity="0.6" d="M15,29C7.28,29,1,22.72,1,15C1,7.281,7.28,1,15,1s14,6.281,14,14C29,22.72,22.719,29,15,29L15,29z"/>
+<path d="M15,2c7.18,0,13,5.82,13,13c0,7.179-5.82,13-13,13C7.82,28,2,22.18,2,15C2,7.82,7.82,2,15,2z"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="305.8604" y1="367.5547" x2="305.8604" y2="392.4656" gradientTransform="matrix(1 0 0 1 -290.8594 -365.0547)">
+	<stop  offset="0" style="stop-color:#C9C9C9"/>
+	<stop  offset="0.0036" style="stop-color:#C5C5C5"/>
+	<stop  offset="0.1336" style="stop-color:#575757"/>
+	<stop  offset="0.2462" style="stop-color:#252525"/>
+	<stop  offset="0.4022" style="stop-color:#090909"/>
+	<stop  offset="0.5232" style="stop-color:#020202"/>
+	<stop  offset="0.8589" style="stop-color:#000000"/>
+	<stop  offset="0.9455" style="stop-color:#020202"/>
+	<stop  offset="1" style="stop-color:#303030"/>
+</linearGradient>
+<ellipse fill="url(#SVGID_1_)" cx="15" cy="15" rx="12.5" ry="12.5"/>
+<circle fill="#FFFFFF" cx="14.999" cy="15" r="0.693"/>
+<path fill="#FFFFFF" d="M12.267,21.033c1.907,0,3.698-0.736,5.045-2.078l0,0l1.592-1.583c0.329-0.329,0.494-0.754,0.494-1.185l0,0
+	c0-0.426-0.165-0.854-0.497-1.184l0,0c-0.327-0.329-0.755-0.492-1.187-0.493l0,0c-0.434,0.001-0.863,0.165-1.193,0.494l0,0
+	l-1.589,1.582c-0.709,0.702-1.657,1.097-2.657,1.097l0,0V17.68c-0.001,0.004-0.003,0.004-0.005,0.004l0,0h-0.025V17.68
+	c-1.001-0.004-1.941-0.393-2.642-1.094l0,0c-0.71-0.707-1.107-1.651-1.109-2.652l0,0c0.001-1,0.399-1.946,1.108-2.654l0,0
+	l3.941-3.92c0.329-0.33,0.493-0.756,0.493-1.188l0,0c0-0.43-0.164-0.856-0.491-1.184l0,0c-0.33-0.329-0.759-0.492-1.19-0.492l0,0
+	c-0.434,0-0.864,0.164-1.192,0.493l0,0L7.219,8.911c-1.347,1.34-2.09,3.124-2.093,5.024l0,0v0.004c0,1.899,0.746,3.676,2.093,5.014
+	l0,0C8.565,20.295,10.357,21.033,12.267,21.033L12.267,21.033"/>
+<path fill="#FFFFFF" d="M20.406,13.422c0.734,0.73,1.102,1.69,1.102,2.65l0,0c0,0.959-0.367,1.921-1.104,2.652l0,0l-3.942,3.921
+	c-0.33,0.331-0.492,0.758-0.492,1.19l0,0c0,0.43,0.161,0.854,0.492,1.184l0,0c0.328,0.326,0.76,0.488,1.192,0.488l0,0
+	c0.433,0,0.86-0.162,1.188-0.488l0,0l3.946-3.924c1.392-1.387,2.088-3.203,2.088-5.022l0,0c0-1.82-0.694-3.637-2.086-5.021l0,0
+	c-1.351-1.343-3.138-2.08-5.052-2.08l0,0c-1.907,0-3.695,0.738-5.045,2.079l0,0l-1.591,1.584c-0.33,0.329-0.493,0.754-0.493,1.183
+	l0,0c0,0.43,0.163,0.854,0.495,1.184l0,0c0.33,0.329,0.759,0.492,1.188,0.492l0,0c0.434,0,0.862-0.162,1.192-0.49l0,0l1.588-1.582
+	c0.737-0.732,1.705-1.098,2.666-1.098l0,0C18.702,12.325,19.67,12.691,20.406,13.422L20.406,13.422z"/>
+<rect fill="none" width="30" height="30"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/res/images/pri_small_star.svg	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
+	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
+]>
+<svg version="1.1"
+	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
+	 x="0px" y="0px" width="30px" height="30px" viewBox="0 0 30 30" enable-background="new 0 0 30 30" xml:space="preserve">
+<defs>
+</defs>
+<polygon opacity="0.6" points="15,0.734 19.635,10.126 30,11.632 22.5,18.943 24.27,29.266 15,24.393 5.73,29.266 7.5,18.943 
+	0,11.632 10.365,10.126 "/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="15" y1="2.9937" x2="15" y2="27.438">
+	<stop  offset="0" style="stop-color:#FFE896"/>
+	<stop  offset="1" style="stop-color:#FFB701"/>
+</linearGradient>
+<polygon fill="url(#SVGID_1_)" points="15,23.262 7.058,27.438 8.574,18.594 2.149,12.331 11.029,11.04 15,2.994 18.971,11.04 
+	27.852,12.331 21.426,18.594 22.941,27.438 "/>
+<polygon fill="#FFFFFF" fill-opacity="0.4" points="11.693,11.954 15,5.253 18.307,11.954 26.959,13.201 27.852,12.331 
+	18.971,11.04 15,2.994 11.029,11.04 2.149,12.331 3.042,13.201 "/>
+<rect fill="none" width="30" height="30"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/res/images/pri_small_star_inactive.svg	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
+	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
+]>
+<svg version="1.1"
+	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
+	 x="0px" y="0px" width="30px" height="30px" viewBox="0 0 30 30" enable-background="new 0 0 30 30" xml:space="preserve">
+<defs>
+</defs>
+<path opacity="0.6" d="M15,24.393l-9.27,4.873L7.5,18.943L0,11.632l10.365-1.506L15,0.734l4.635,9.392L30,11.632l-7.5,7.311
+	l1.77,10.322L15,24.393z M19.621,22.867l-0.881-5.146l3.738-3.645l-5.168-0.751L15,8.643l-2.311,4.683l-5.168,0.751l3.739,3.645
+	l-0.882,5.146L15,20.438L19.621,22.867z"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="15" y1="2.9937" x2="15" y2="27.438">
+	<stop  offset="0" style="stop-color:#F0F0F0"/>
+	<stop  offset="1" style="stop-color:#C8C8C8"/>
+</linearGradient>
+<path fill="url(#SVGID_1_)" d="M27.852,12.331l-8.881-1.291L15,2.994l-3.971,8.046l-8.88,1.291l6.425,6.263l-1.516,8.844L15,23.262
+	l7.941,4.176l-1.516-8.844L27.852,12.331z M15,21.567l-5.95,3.128l1.136-6.625l-4.814-4.692l6.653-0.967L15,6.383l2.975,6.028
+	l6.653,0.967l-4.813,4.692l1.135,6.625L15,21.567z"/>
+<rect fill="none" width="30" height="30"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/res/images/pri_small_tag.svg	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
+	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
+]>
+<svg version="1.1"
+	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
+	 x="0px" y="0px" width="30px" height="30px" viewBox="0 0 30 30" enable-background="new 0 0 30 30" xml:space="preserve">
+<defs>
+</defs>
+<path opacity="0.6" d="M2,12.731V4.094L4.094,2h8.638l15.683,15.684l-10.731,10.73L2,12.731z M6.904,5.952
+	c-0.525,0-0.952,0.427-0.952,0.952s0.427,0.953,0.952,0.953S7.857,7.43,7.857,6.904S7.43,5.952,6.904,5.952L6.904,5.952z"/>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="14.9995" y1="3" x2="14.9995" y2="27.0005">
+	<stop  offset="0" style="stop-color:#4EDEFF"/>
+	<stop  offset="1" style="stop-color:#048CC6"/>
+</linearGradient>
+<path fill="url(#SVGID_1_)" d="M27,17.684L12.317,3h-7.81L3,4.508v7.81L17.683,27L27,17.684z M6.904,8.857
+	c-1.078,0-1.952-0.875-1.952-1.953s0.874-1.952,1.952-1.952s1.953,0.874,1.953,1.952S7.982,8.857,6.904,8.857z"/>
+<path opacity="0.4" fill="#FFFFFF" d="M6.904,9.857c1.078,0,1.953-0.875,1.953-1.953c0-0.174-0.03-0.34-0.072-0.5
+	C8.563,8.239,7.809,8.857,6.904,8.857S5.247,8.239,5.025,7.404c-0.043,0.16-0.073,0.326-0.073,0.5
+	C4.952,8.982,5.826,9.857,6.904,9.857z"/>
+<polygon opacity="0.4" fill="#FFFFFF" points="12.317,4 26.5,18.184 27,17.684 12.317,3 4.508,3 3,4.508 3,5.508 4.508,4 "/>
+<rect x="10.07" y="12.386" transform="matrix(0.7071 0.7071 -0.7071 0.7071 16.0477 -6.6462)" fill="#FFFFFF" width="11.951" height="7.321"/>
+<polygon opacity="0.4" fill="#FFFFFF" points="17.683,22.859 9.232,14.429 8.662,15 17.683,24 23.43,18.254 22.859,17.684 "/>
+<polygon opacity="0.15" points="14.409,10.373 22.289,18.254 22.859,17.684 14.409,9.232 9.232,14.41 9.803,14.98 "/>
+<rect fill="none" width="30" height="30"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/res/images/qtg_fr_lcd.svg	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
+	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
+]>
+<svg version="1.1"
+	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
+	 x="0px" y="0px" width="338px" height="224px" viewBox="0 0 338 224" enable-background="new 0 0 338 224" xml:space="preserve">
+<defs>
+</defs>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="169.0005" y1="223" x2="169.0005" y2="1.0005">
+	<stop  offset="0" style="stop-color:#365E8F"/>
+	<stop  offset="0.3758" style="stop-color:#20344E"/>
+	<stop  offset="1" style="stop-color:#09090D"/>
+</linearGradient>
+<path fill="url(#SVGID_1_)" d="M6,223c-2.757,0-5-2.243-5-5V6c0-2.757,2.243-5,5-5h326c2.757,0,5,2.243,5,5v212c0,2.757-2.243,5-5,5
+	H6z"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="0" y1="112" x2="338" y2="112">
+	<stop  offset="0" style="stop-color:#09090D;stop-opacity:0.5"/>
+	<stop  offset="0.4" style="stop-color:#09090D;stop-opacity:0"/>
+	<stop  offset="0.6" style="stop-color:#09090D;stop-opacity:0"/>
+	<stop  offset="1" style="stop-color:#09090D;stop-opacity:0.5"/>
+</linearGradient>
+<path fill="url(#SVGID_2_)" d="M6,224c-3.309,0-6-2.691-6-6V6c0-3.309,2.691-6,6-6h326c3.309,0,6,2.691,6,6v212c0,3.309-2.691,6-6,6
+	H6z"/>
+<linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="2.0254" y1="222" x2="335.9746" y2="222">
+	<stop  offset="0" style="stop-color:#376294"/>
+	<stop  offset="0.5" style="stop-color:#BAE6FF"/>
+	<stop  offset="1" style="stop-color:#376294"/>
+</linearGradient>
+<path fill="url(#SVGID_3_)" fill-opacity="0.8" d="M335.975,221H2.025c0.914,1.207,2.348,2,3.975,2h326
+	C333.627,223,335.061,222.207,335.975,221z"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/res/images/qtg_fr_lcd_overlay.svg	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
+	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
+]>
+<svg version="1.1"
+	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
+	 x="0px" y="0px" width="338px" height="224px" viewBox="0 0 338 224" enable-background="new 0 0 338 224" xml:space="preserve">
+<defs>
+</defs>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="169" y1="103" x2="169" y2="0">
+	<stop  offset="0" style="stop-color:#3E6DA3"/>
+	<stop  offset="1" style="stop-color:#E0EFFF"/>
+</linearGradient>
+<path fill="url(#SVGID_1_)" fill-opacity="0.4" d="M332,0H6C2.691,0,0,2.691,0,6v83.972C48.129,98.19,106.315,103,169,103
+	s120.871-4.81,169-13.028V6C338,2.691,335.309,0,332,0z"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="0" y1="112" x2="338" y2="112">
+	<stop  offset="0" style="stop-color:#00000D;stop-opacity:0.7"/>
+	<stop  offset="0.25" style="stop-color:#00000D;stop-opacity:0"/>
+	<stop  offset="0.75" style="stop-color:#00000D;stop-opacity:0"/>
+	<stop  offset="1" style="stop-color:#00000D;stop-opacity:0.7"/>
+</linearGradient>
+<path fill="url(#SVGID_2_)" d="M6,224c-3.309,0-6-2.691-6-6V6c0-3.309,2.691-6,6-6h326c3.309,0,6,2.691,6,6v212c0,3.309-2.691,6-6,6
+	H6z"/>
+<path fill="#FFFFFF" fill-opacity="0.2" d="M332,0H6C2.7,0,0,2.7,0,6v212c0,3.3,2.7,6,6,6h326c3.3,0,6-2.7,6-6V6
+	C338,2.7,335.3,0,332,0z M337,218c0,2.757-2.243,5-5,5H6c-2.757,0-5-2.243-5-5V6c0-2.757,2.243-5,5-5h326c2.757,0,5,2.243,5,5V218z"
+	/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/res/images/qtg_fr_tuner.svg	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
+	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
+]>
+<svg version="1.1"
+	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
+	 x="0px" y="0px" width="338px" height="60px" viewBox="0 0 338 60" enable-background="new 0 0 338 60" xml:space="preserve">
+<defs>
+</defs>
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="169.0005" y1="60" x2="169.0005" y2="4.882813e-004">
+	<stop  offset="0" style="stop-color:#2A4A70"/>
+	<stop  offset="1" style="stop-color:#09090D"/>
+</linearGradient>
+<rect fill="url(#SVGID_1_)" width="338" height="60"/>
+<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="1" y1="58" x2="337" y2="58">
+	<stop  offset="0" style="stop-color:#376294"/>
+	<stop  offset="0.5" style="stop-color:#BAE6FF"/>
+	<stop  offset="1" style="stop-color:#376294"/>
+</linearGradient>
+<rect x="1" y="57" fill="url(#SVGID_2_)" fill-opacity="0.8" width="336" height="2"/>
+<linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="1" y1="30" x2="337" y2="30">
+	<stop  offset="0" style="stop-color:#00000D;stop-opacity:0.9"/>
+	<stop  offset="0.3" style="stop-color:#00000D;stop-opacity:0"/>
+	<stop  offset="0.7" style="stop-color:#00000D;stop-opacity:0"/>
+	<stop  offset="1" style="stop-color:#00000D;stop-opacity:0.9"/>
+</linearGradient>
+<rect x="1" y="1" fill="url(#SVGID_3_)" width="336" height="58"/>
+<linearGradient id="SVGID_4_" gradientUnits="userSpaceOnUse" x1="169" y1="21" x2="169" y2="3">
+	<stop  offset="0" style="stop-color:#203956"/>
+	<stop  offset="1" style="stop-color:#CCE4FF"/>
+</linearGradient>
+<rect x="3" y="3" fill="url(#SVGID_4_)" fill-opacity="0.5" width="332" height="18"/>
+<path opacity="0.4" fill="#FFFFFF" d="M337,1v58H1V1H337 M338,0H0v60h338V0L338,0z"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/res/images/qtg_mono_next.svg	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
+	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
+]>
+<svg version="1.1"
+	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
+	 x="0px" y="0px" width="30px" height="30px" viewBox="0 0.002 30 30" enable-background="new 0 0.002 30 30" xml:space="preserve">
+<defs>
+</defs>
+<g opacity="0.5">
+	<rect fill="none" width="30" height="30"/>
+</g>
+<polygon points="20,4 20,15 20,26 24,26 24,4 "/>
+<polygon points="6,26 20,15 6,4 "/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/res/images/qtg_mono_play_history.svg	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
+	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
+]>
+<svg version="1.1"
+	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
+	 x="0px" y="0px" width="30px" height="30px" viewBox="0 0 30 30" enable-background="new 0 0 30 30" xml:space="preserve">
+<defs>
+</defs>
+<g opacity="0.5">
+	<rect fill="none" width="30" height="30"/>
+</g>
+<path d="M22.5,13c0.232,0,0.461,0.019,0.688,0.035L25,12L4,0v24l9.998-5.713C15.555,15.159,18.776,13,22.5,13z"/>
+<path d="M22.5,15c-4.136,0-7.5,3.364-7.5,7.5s3.364,7.5,7.5,7.5s7.5-3.364,7.5-7.5S26.636,15,22.5,15z M22.5,28
+	c-3.033,0-5.5-2.468-5.5-5.5s2.467-5.5,5.5-5.5s5.5,2.468,5.5,5.5S25.533,28,22.5,28z"/>
+<polygon points="23,22 23,18 21,18 21,22 21,24 23,24 27,24 27,22 "/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/res/images/qtg_mono_previous.svg	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
+	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
+]>
+<svg version="1.1"
+	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
+	 x="0px" y="0px" width="30px" height="30px" viewBox="0 0.002 30 30" enable-background="new 0 0.002 30 30" xml:space="preserve">
+<defs>
+</defs>
+<g opacity="0.5">
+	<rect fill="none" width="30" height="30"/>
+</g>
+<polygon points="6,4 6,26 10,26 10,15 10,4 "/>
+<polygon points="10,15 24,26 24,4 "/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/res/images/qtg_mono_radio_stations.svg	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 13.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 14948)  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 width="30px" height="30px" viewBox="0 0 30 30" enable-background="new 0 0 30 30" xml:space="preserve">
+<g opacity="0.5">
+	<rect fill="none" width="30" height="30"/>
+</g>
+<rect x="7" y="6" width="2" height="2"/>
+<rect x="7" y="11" width="2" height="2"/>
+<rect x="7" y="16" width="2" height="2"/>
+<rect x="7" y="21" width="2" height="2"/>
+<rect x="10.059" y="6" width="9.942" height="2"/>
+<rect x="10.059" y="11" width="9.942" height="2"/>
+<rect x="10.059" y="21" width="4.941" height="2"/>
+<path d="M15,17c0-0.357,0.103-0.699,0.277-1h-5.219v2H15V17z"/>
+<path d="M11.322,26H5V3h18v10.841c0.23-0.124,0.473-0.216,0.727-0.243c0.101-0.24,0.246-0.461,0.435-0.648l1.362-1.363
+	c0.145-0.144,0.308-0.252,0.478-0.342V0H2v29h9.325c-0.18-0.469-0.296-0.963-0.296-1.486C11.029,26.982,11.135,26.473,11.322,26z"/>
+<path d="M22.579,23.634L23.945,25c0.06-0.055,0.119-0.104,0.179-0.163c2.506-2.506,2.502-6.587-0.006-9.097
+	c-0.058-0.057-0.117-0.104-0.173-0.154l-1.362,1.361c0.058,0.053,0.114,0.101,0.172,0.156c1.757,1.756,1.759,4.613,0.004,6.367
+	C22.7,23.529,22.637,23.578,22.579,23.634z"/>
+<path d="M27.107,13.155c-0.055-0.056-0.112-0.101-0.17-0.155l-1.362,1.363c0.055,0.052,0.114,0.1,0.17,0.155
+	c3.101,3.099,3.104,8.136,0.008,11.231c-0.058,0.058-0.121,0.108-0.183,0.164l1.367,1.366c0.06-0.057,0.123-0.107,0.183-0.166
+	C30.965,23.27,30.961,17.008,27.107,13.155z"/>
+<path d="M22.029,19L17,17v8.305c-0.254-0.152-0.666-0.244-1.107-0.244c-1.583,0-2.864,1.098-2.864,2.453S14.31,30,15.893,30
+	C17.475,30,19,29,19,27.514V21l3.029,1V19L22.029,19z"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/res/images/qtg_mono_speaker.svg	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
+	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
+]>
+<svg version="1.1"
+	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
+	 x="0px" y="0px" width="30px" height="30px" viewBox="0 0 30 30" enable-background="new 0 0 30 30" xml:space="preserve">
+<defs>
+</defs>
+<g opacity="0.5">
+	<rect fill="none" width="30" height="30"/>
+</g>
+<rect x="1" y="9" width="7" height="12"/>
+<polygon points="10,22 21,27 21,3 10,8 "/>
+<path d="M23.889,8.046L22.213,9.14C23.382,10.931,24,12.957,24,15s-0.618,4.069-1.787,5.86l1.676,1.094
+	C25.27,19.836,26,17.432,26,15S25.27,10.164,23.889,8.046z"/>
+<path d="M26.702,5.398l-1.598,1.203C26.999,9.118,28,12.021,28,15s-1.001,5.882-2.896,8.398l1.598,1.203
+	C28.859,21.735,30,18.416,30,15S28.859,8.265,26.702,5.398z"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/res/images/qtg_mono_speaker_off.svg	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
+	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
+]>
+<svg version="1.1"
+	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
+	 x="0px" y="0px" width="30px" height="30px" viewBox="0 0 30 30" enable-background="new 0 0 30 30" xml:space="preserve">
+<defs>
+</defs>
+<rect fill="none" width="30" height="30"/>
+<polygon points="4.853,9 1,9 1,21 8,21 8,12.148 "/>
+<polygon points="21,16.852 21,3 11.478,7.328 "/>
+<polygon points="10,14.148 10,22 21,27 21,25.146 "/>
+<rect x="13.74" y="-3.242" transform="matrix(0.7063 -0.7079 0.7079 0.7063 -6.0767 14.6963)" width="1.868" height="35.827"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/res/images/qtg_mono_station_scan.svg	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
+	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
+]>
+<svg version="1.1"
+	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
+	 x="0px" y="0px" width="30px" height="30px" viewBox="0 0 30 30" enable-background="new 0 0 30 30" xml:space="preserve">
+<defs>
+</defs>
+<g opacity="0.5">
+	<rect fill="none" width="30" height="30"/>
+</g>
+<rect x="13" y="8" width="4" height="15"/>
+<rect x="9" y="12" width="2" height="7"/>
+<rect x="5" y="12" width="2" height="7"/>
+<rect x="1" y="12" width="2" height="7"/>
+<rect x="27" y="12" width="2" height="7"/>
+<rect x="23" y="12" width="2" height="7"/>
+<rect x="19" y="12" width="2" height="7"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/res/images/qtg_mono_tag.svg	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
+	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
+]>
+<svg version="1.1"
+	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
+	 x="0px" y="0px" width="30px" height="30px" viewBox="0 0 30 30" enable-background="new 0 0 30 30" xml:space="preserve">
+<defs>
+</defs>
+<g opacity="0.5">
+	<rect fill="none" width="30" height="30"/>
+</g>
+<path d="M12.731,2H4.094L2,4.094v8.638l15.683,15.683l10.731-10.731L12.731,2z M4,11.903V4.922L4.922,4h6.981l13.683,13.683
+	l-7.903,7.903L4,11.903z"/>
+<rect x="12.385" y="10.071" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -6.6464 16.0459)" width="7.321" height="11.95"/>
+<circle cx="7" cy="7" r="2"/>
+</svg>
Binary file radioapp/radiowidgets/res/images/setfavoriteicon.png has changed
Binary file radioapp/radiowidgets/res/images/stripbackground.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/res/layout/historyview.docml	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,161 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument context="RadioHistoryView" version="1.0">
+    <object name="hv:clear_list_action" type="HbAction">
+        <string locid="txt_rad_opt_clear_list" name="text"/>
+    </object>
+    <object name="hv:add_songs_action" type="HbAction">
+        <string value="DEBUG: Add Songs" name="text"/>
+    </object>
+    <object name="loudspeaker_action" type="HbAction">
+        <string locid="txt_common_opt_activate_loudspeaker" name="text"/>
+    </object>
+    <object name="exit_action" type="HbAction">
+        <string locid="txt_common_opt_exit" name="text"/>
+    </object>
+    <object name="hv:all_songs_button" type="HbAction">
+        <bool name="checkable" value="TRUE"/>
+        <string locid="txt_rad_button_recently_played_songs" name="text"/>
+    </object>
+    <object name="hv:tagged_songs_button" type="HbAction">
+        <bool name="checkable" value="TRUE"/>
+        <string locid="txt_rad_button_tagged_songs" name="text"/>
+    </object>
+    <object name="hv:toggle_tag_action" type="HbAction">
+        <string locid="txt_rad_menu_tag_song" name="text"/>
+    </object>
+    <object name="hv:search_from_ovi_store_action" type="HbAction">
+        <string locid="txt_rad_menu_search_from_music_store" name="text"/>
+    </object>
+    <object name="hv:search_from_other_store_action" type="HbAction">
+        <string locid="txt_rad_menu_search_from_other_store" name="text"/>
+    </object>
+    <widget name="view" plugin="radiowidgetsplugin" type="RadioHistoryView">
+        <icon name="nonTaggedIcon" iconName=":/images/qtg_mono_tag.svg" />
+        <icon name="taggedIcon" iconName=":/images/pri_small_tag.svg" />
+        <widget name="hv:menu" role="HbView:menu" type="HbMenu">
+            <ref object="hv:clear_list_action" role="HbMenu:addAction"/>
+            <ref object="hv:add_songs_action" role="HbMenu:addAction"/>
+            <ref object="loudspeaker_action" role="HbMenu:addAction"/>
+            <ref object="exit_action" role="HbMenu:addAction"/>
+        </widget>
+        <widget name="hv:toolbar" role="HbView:toolBar" type="HbToolBar">
+            <enums name="orientation" value="Horizontal"/>
+            <ref object="hv:all_songs_button" role="HbToolBar:addAction"/>
+            <ref object="hv:tagged_songs_button" role="HbToolBar:addAction"/>
+        </widget>
+        <widget name="content" role="HbView:widget" type="HbWidget">
+            <widget name="hv:heading_banner" plugin="radiowidgetsplugin" type="RadioBannerLabel">
+                <sizehint height="30" type="MAXIMUM"/>
+                <string name="plainText" locid="txt_rad_subhead_play_history" />
+            </widget>            
+            <widget name="hv:stacked_widget" type="HbWidget">
+                <widget name="hv:history_list" type="HbListView">
+                    <sizehint height="320" type="PREFERRED" width="240"/>
+                    <bool name="visible" value="FALSE"/>
+                </widget>
+                <widget name="hv:empty_container" type="HbWidget">
+                    <widget name="hv:empty_title" type="HbLabel">
+                        <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+                        <string locid="txt_rad_info_play_history_is_empty" name="plainText"/>
+                        <fontspec name="fontSpec" role="Title" textheight="33.5"/>
+                    </widget>
+                    <widget name="hv:empty_text" type="HbLabel">
+                        <enums name="textWrapping" value="TextWordWrap"/>
+                        <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+                        <sizehint height="320" type="PREFERRED" width="240"/>
+                        <string locid="txt_rad_info_recently_played_songs_collects_song2" name="plainText"/>
+                        <fontspec name="fontSpec" role="Title" textheight="33.5"/>
+                    </widget>
+                    <layout orientation="Vertical" spacing="var(hb-param-margin-gene-middle-vertical)" type="linear">
+                        <contentsmargins bottom="var(hb-param-margin-gene-bottom)" left="var(hb-param-margin-gene-left)" right="var(hb-param-margin-gene-right)" top="var(hb-param-margin-gene-top)"/>
+                        <stretchitem stretchfactor="2"/>
+                        <linearitem itemname="hv:empty_title"/>
+                        <stretchitem stretchfactor="1"/>
+                        <linearitem itemname="hv:empty_text"/>
+                        <stretchitem stretchfactor="2"/>
+                    </layout>
+                </widget>
+                <layout type="stacked">
+                    <stackitem itemname="hv:history_list"/>
+                    <stackitem itemname="hv:empty_container"/>
+                </layout>
+            </widget>
+            <layout type="anchor">
+                <anchoritem dst="hv:heading_banner" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
+                <anchoritem dst="hv:heading_banner" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+                <anchoritem dst="hv:heading_banner" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+                <anchoritem dst="hv:stacked_widget" dstEdge="TOP" spacing="0un" src="hv:heading_banner" srcEdge="BOTTOM"/>
+                <anchoritem dst="hv:stacked_widget" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
+                <anchoritem dst="hv:stacked_widget" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+                <anchoritem dst="hv:stacked_widget" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+            </layout>
+        </widget>
+        <string locid="txt_rad_title_fm_radio" name="title"/>
+    </widget>
+    <widget name="hv:context_menu" type="HbMenu">
+        <ref object="hv:toggle_tag_action" role="HbMenu:addAction"/>
+        <ref object="hv:search_from_ovi_store_action" role="HbMenu:addAction"/>
+        <ref object="hv:search_from_other_store_action" role="HbMenu:addAction"/>
+    </widget>
+    <connect receiver="view" sender="exit_action" signal="triggered()" slot="quit()"/>
+    <connect receiver="hv:tagged_songs_button" sender="hv:all_songs_button" signal="triggered()" slot="toggle()"/>
+    <connect receiver="hv:all_songs_button" sender="hv:tagged_songs_button" signal="triggered()" slot="toggle()"/>
+    <connect receiver="view" sender="hv:history_list" signal="activated(QModelIndex)" slot="showContextMenu(QModelIndex)"/>
+    <connect receiver="view" sender="hv:toggle_tag_action" signal="triggered()" slot="toggleTagging()"/>
+    <connect receiver="view" sender="hv:search_from_ovi_store_action" signal="triggered()" slot="openOviStore()"/>
+    <connect receiver="view" sender="hv:search_from_other_store_action" signal="triggered()" slot="openOtherStore()"/>
+    <section name="hv:show_list">
+        <widget name="hv:history_list">
+            <bool name="visible" value="TRUE"/>
+        </widget>
+        <widget name="hv:empty_container">
+            <bool name="visible" value="FALSE"/>
+        </widget>
+        <object name="hv:clear_list_action">
+            <bool name="visible" value="TRUE"/>
+        </object>
+    </section>
+    <section name="hv:hide_list">
+        <widget name="hv:history_list">
+            <bool name="visible" value="FALSE"/>
+        </widget>
+        <widget name="hv:empty_container">
+            <bool name="visible" value="TRUE"/>
+        </widget>
+        <object name="hv:clear_list_action">
+            <bool name="visible" value="FALSE"/>
+        </object>
+    </section>
+    <section name="hv:history_mode">
+        <object name="hv:all_songs_button">
+            <bool name="checked" value="TRUE"/>
+        </object>
+        <object name="hv:tagged_songs_button">
+            <bool name="checked" value="FALSE"/>
+        </object>
+        <widget name="hv:empty_text">
+            <string locid="txt_rad_info_recently_played_songs_collects_song2" name="plainText"/>
+        </widget>
+        <widget name="hv:heading_banner">
+            <string name="plainText" locid="txt_rad_subhead_play_history" />
+        </widget>
+    </section>
+    <section name="hv:tagged_mode">
+        <object name="hv:all_songs_button">
+            <bool name="checked" value="FALSE"/>
+        </object>
+        <object name="hv:tagged_songs_button">
+            <bool name="checked" value="TRUE"/>
+        </object>
+        <widget name="hv:empty_text">
+            <string locid="txt_rad_info_you_can_add_song_to_the_tagged_songs" name="plainText"/>
+        </widget>
+        <widget name="hv:heading_banner">
+            <string name="plainText" locid="txt_rad_button_tagged_songs" />
+        </widget>
+    </section>
+    <metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
+        <uistate name="Common ui state" sections="#common"/>
+        <dummydata objectName="hv:history_list" section="#common" value="app_list_template5"/>
+    </metadata>
+</hbdocument>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/res/layout/mainview.docml	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument context="RadioMainView" version="0.9">
+    <object name="mv:historyview_action" type="HbAction">
+        <string name="text" locid="txt_rad_opt_play_history" />
+    </object>
+    <object name="exit_action" type="HbAction">
+        <string name="text" locid="txt_common_opt_exit" />
+    </object>
+    <widget name="view" plugin="radiowidgetsplugin" type="RadioMainView">
+        <widget name="menu" role="HbView:menu" type="HbMenu">
+            <ref object="mv:historyview_action" role="HbMenu:addAction"/>
+            <ref object="exit_action" role="HbMenu:addAction"/>
+        </widget>
+        <widget name="mv:container" role="HbView:widget" type="HbWidget">
+            <widget name="mv:info_area" type="HbWidget">
+                <widget name="mv:carousel_background" type="HbLabel">
+                    <icon name="icon" iconName=":/images/qtg_fr_lcd.svg" />
+                    <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+                </widget>
+                <widget name="mv:carousel_overlay" type="HbLabel">
+                    <icon name="icon" iconName=":/images/qtg_fr_lcd_overlay.svg" />
+                    <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+                </widget>
+                <widget name="mv:station_carousel" plugin="radiowidgetsplugin" type="RadioStationCarousel">
+                    <icon name="favoriteIcon" iconName=":/images/pri_small_star.svg" />
+                    <icon name="nonFavoriteIcon" iconName=":/images/pri_small_star_inactive.svg" />
+                    <widget name="mv:info_text" type="HbLabel" >
+                        <bool name="visible" value="FALSE"/>
+                        <sizehint height="200" width="300" type="PREFERRED"/>
+                    </widget>
+                </widget>
+                <layout type="stacked">
+                    <stackitem itemname="mv:carousel_background"/>
+                    <stackitem itemname="mv:carousel_overlay"/>
+                    <stackitem itemname="mv:station_carousel"/>
+                </layout>
+            </widget>
+            <widget name="mv:control_widget" type="HbWidget" >
+                <widget name="mv:stations_button" type="HbPushButton">
+                    <bool name="stretched" value="TRUE" />
+                    <string name="text" locid="txt_rad_button_stations" />
+                    <icon name="icon" iconName="qtg_mono_radio_stations.svg" />
+                </widget>
+                <widget name="mv:scan_button" type="HbPushButton">
+                    <bool name="stretched" value="TRUE" />
+                    <string name="text" locid="txt_rad_button_search_all_stations" />
+                    <icon name="icon" iconName="qtg_mono_station_scan.svg" />
+                </widget>
+                <widget name="mv:loudspeaker_button" type="HbPushButton">
+                    <bool name="stretched" value="TRUE" />
+                    <string name="text" locid="txt_rad_button_activate_loudspeaker" />
+                    <icon name="icon" iconName="qtg_mono_speaker.svg" />
+                </widget>
+                <layout orientation="Vertical" spacing="var(hb-param-margin-gene-middle-vertical)" type="linear">
+                    <contentsmargins bottom="var(hb-param-margin-gene-bottom)" left="var(hb-param-margin-gene-left)" right="var(hb-param-margin-gene-right)" top="var(hb-param-margin-gene-top)"/>
+                    <linearitem itemname="mv:stations_button"/>
+                    <stretchitem stretchfactor="1"/>
+                    <linearitem itemname="mv:scan_button"/>
+                    <stretchitem stretchfactor="1"/>
+                    <linearitem itemname="mv:loudspeaker_button"/>
+                </layout>
+            </widget>
+            <widget name="mv:frequency_area" type="HbWidget">
+                 <widget name="mv:frequency_background" type="HbLabel">
+                    <icon name="icon" iconName=":/images/qtg_fr_tuner.svg" />
+                    <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+                </widget>
+               <widget name="mv:frequency_strip" plugin="radiowidgetsplugin" type="RadioFrequencyStrip">
+                    <icon name="leftButtonIcon" iconName=":/images/qtg_mono_previous.svg" />
+                    <icon name="rightButtonIcon" iconName=":/images/qtg_mono_next.svg" />
+                    <integer name="autoScrollTime" value="1000"/>
+                </widget>
+                <layout type="stacked">
+                    <stackitem itemname="mv:frequency_background"/>
+                    <stackitem itemname="mv:frequency_strip"/>
+                </layout>
+            </widget>
+        </widget>
+        <string name="title" locid="txt_rad_title_fm_radio"/>
+    </widget>
+    <connect receiver="view" sender="exit_action" signal="triggered()" slot="quit()"/>
+    <section name="portrait">
+        <widget name="mv:frequency_area">
+            <sizehint height="70" width="360" type="PREFERRED"/>
+        </widget>
+        <widget name="mv:info_area">
+            <sizehint height="280" type="PREFERRED" width="360"/>
+        </widget>
+        <widget name="mv:control_widget">
+            <sizehint height="280" type="PREFERRED" width="300"/>
+        </widget>
+        <widget name="mv:container">
+            <layout orientation="Vertical" spacing="0un" type="linear">
+                <linearitem itemname="mv:info_area"/>
+                <linearitem itemname="mv:frequency_area"/>
+                <linearitem itemname="mv:control_widget"/>
+            </layout>
+        </widget>
+    </section>
+    <section name="landscape">
+        <widget name="mv:frequency_area">
+            <sizehint height="50" width="640" type="PREFERRED"/>
+        </widget>
+        <widget name="mv:info_area">
+            <sizehint height="300" type="PREFERRED" width="230"/>
+        </widget>
+        <widget name="mv:control_widget">
+            <sizehint height="230" type="PREFERRED" width="230"/>
+        </widget>
+        <widget name="mv:container">
+            <layout spacing="0un" type="grid">
+                <griditem column="0" itemname="mv:info_area" row="0"/>
+                <griditem column="1" itemname="mv:control_widget" row="0"/>
+                <griditem column="0" itemname="mv:frequency_area" row="1" column_span="2" />
+            </layout>
+        </widget>
+    </section>
+    <!-- Scanning layout -->
+    <section name="mv:scanning">
+        <object name="mv:historyview_action">
+            <bool name="visible" value="FALSE"/>
+        </object>
+        <widget name="mv:stations_button">
+            <bool name="visible" value="FALSE"/>
+        </widget>
+        <widget name="mv:scan_button">
+            <string name="text" locid="txt_rad_button_cancel" />
+            <icon name="icon" iconName=" " />
+        </widget>
+        <widget name="mv:loudspeaker_button">
+            <bool name="visible" value="FALSE"/>
+        </widget>
+    </section>
+
+    <!-- Normal layout (not scanning) -->
+    <section name="mv:normal">
+        <object name="mv:historyview_action">
+            <bool name="visible" value="TRUE"/>
+        </object>
+        <widget name="mv:stations_button">
+            <bool name="visible" value="TRUE"/>
+        </widget>
+        <widget name="mv:scan_button">
+            <string name="text" locid="txt_rad_button_search_all_stations" />
+            <icon name="icon" iconName="qtg_mono_station_scan.svg" />
+        </widget>
+        <widget name="mv:loudspeaker_button">
+            <bool name="visible" value="TRUE"/>
+        </widget>
+    </section>
+
+    <metadata activeUIState="portrait" display="NHD portrait" unit="un">
+        <uistate name="Common ui state" sections="#common"/>
+        <uistate name="portrait" sections="#common portrait"/>
+        <uistate name="landscape" sections="#common landscape"/>
+    </metadata>
+</hbdocument>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/res/layout/radiostationitem.css	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,63 @@
+RadioStationItem {
+	layout: default
+}
+
+RadioStationItem::favorite_button {
+	max-width: 6un;
+	max-height: 6un;
+	top: -var(hb-param-margin-gene-top);
+	left: -var(hb-param-margin-gene-left)
+}
+
+RadioStationItem::genre_label {
+	pref-height: 6un;
+	top: -var(hb-param-margin-gene-top);
+	right: 8un;
+	left: -var(hb-param-margin-gene-left);
+}
+
+RadioFadingLabel#genre_label::text {
+    text-align: center;
+    color: lightgray;
+    font-variant: secondary;
+}
+
+RadioStationItem::name_label {
+	pref-height: 5un;
+	left: -var(hb-param-margin-gene-left);
+	top: -var(hb-param-margin-gene-top);
+	right: var(hb-param-margin-gene-right)
+}
+
+RadioFadingLabel#name_label::text {
+    text-align: center;
+    color: white;
+    font-variant: primary;
+}
+
+RadioStationItem::rt_label {
+	pref-height: 21un;
+	left: -var(hb-param-margin-gene-left);
+	top: -var(hb-param-margin-gene-top);
+	right: var(hb-param-margin-gene-right);
+}
+
+RadioFadingLabel#rt_label::text {
+    text-align: center;
+    color: white;
+    font-variant: secondary;
+}
+
+RadioStationItem::url_label {
+	pref-height: 5un;
+	left: -var(hb-param-margin-gene-left);
+	top: -var(hb-param-margin-gene-top);
+	right: var(hb-param-margin-gene-right);
+	bottom: var(hb-param-margin-gene-bottom);
+}
+
+RadioFadingLabel#url_label::text {
+    text-align: center;
+    color: white;
+    font-variant: secondary;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/res/layout/radiostationitem.widgetml	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbwidget type="RadioStationItem" version="0.1">
+    <layout name="default" type="mesh">
+        <meshitem dst="" dstEdge="TOP" src="favorite_button" srcEdge="TOP"/>
+        <meshitem dst="" dstEdge="LEFT" src="favorite_button" srcEdge="LEFT"/>
+        
+        <meshitem dst="" dstEdge="TOP" src="genre_label" srcEdge="TOP"/>
+        <meshitem dst="favorite_button" dstEdge="RIGHT" src="genre_label" srcEdge="LEFT"/>
+        <meshitem dst="" dstEdge="RIGHT" src="genre_label" srcEdge="RIGHT"/>
+    
+        <meshitem dst="favorite_button" dstEdge="BOTTOM" src="name_label" srcEdge="TOP"/>
+        <meshitem dst="" dstEdge="LEFT" src="name_label" srcEdge="LEFT"/>
+        <meshitem dst="" dstEdge="RIGHT" src="name_label" srcEdge="RIGHT"/>
+
+        <meshitem dst="name_label" dstEdge="BOTTOM" src="rt_label" srcEdge="TOP"/>
+        <meshitem dst="" dstEdge="LEFT" src="rt_label" srcEdge="LEFT"/>
+        <meshitem dst="" dstEdge="RIGHT" src="rt_label" srcEdge="RIGHT"/>
+        
+        <meshitem dst="rt_label" dstEdge="BOTTOM" src="url_label" srcEdge="TOP"/>        
+        <meshitem dst="" dstEdge="LEFT" src="url_label" srcEdge="LEFT"/>
+        <meshitem dst="" dstEdge="RIGHT" src="url_label" srcEdge="RIGHT"/>
+        <meshitem dst="" dstEdge="BOTTOM" src="url_label" srcEdge="BOTTOM"/>
+    </layout>
+</hbwidget>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/res/layout/stationsview.docml	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument context="RadioStationsView" version="0.9">
+    <object name="sv:scan_action" type="HbAction">
+        <string name="text" locid="txt_rad_opt_search_all_stations" />
+    </object>
+    <object name="sv:clear_list_action" type="HbAction">
+        <string name="text" locid="txt_rad_opt_clear_list" />
+    </object>
+    <object name="loudspeaker_action" type="HbAction">
+        <string name="text" locid="txt_common_opt_activate_loudspeaker" />
+    </object>
+    <object name="exit_action" type="HbAction">
+        <string name="text" locid="txt_common_opt_exit" />
+    </object>
+    <object name="sv:play_action" type="HbAction">
+        <string name="text" locid="txt_common_menu_play_music" />
+    </object>
+    <object name="sv:rename_action" type="HbAction">
+        <string name="text" locid="txt_common_menu_rename_item" />
+    </object>
+    <object name="sv:toggle_favorite_action" type="HbAction">
+        <string name="text" locid="txt_rad_menu_add_to_favourites" />
+    </object>
+    <object name="sv:delete_action" type="HbAction">
+        <string name="text" locid="txt_common_menu_delete" />
+    </object>
+    <object name="sv:local_stations_button" type="HbAction">
+        <bool name="checkable" value="TRUE"/>
+        <icon iconName=":/images/removefavoriteicon.png" name="icon"/>
+        <string name="text" locid="txt_rad_button_local_stations" />
+    </object>
+    <object name="sv:favorite_stations_button" type="HbAction">
+        <bool name="checkable" value="TRUE"/>
+        <icon iconName=":/images/setfavoriteicon.png" name="icon"/>
+        <string name="text" locid="txt_rad_button_favourites" />
+    </object>
+    <widget name="view" plugin="radiowidgetsplugin" type="RadioStationsView">
+        <icon name="nowPlayingIcon" iconName=":/images/nowplayingicon.png" />
+        <icon name="favoriteIcon" iconName=":/images/setfavoriteicon.png" />
+        <widget name="mMenu" role="HbView:menu" type="HbMenu">
+            <ref object="sv:scan_action" role="HbMenu:addAction"/>
+            <ref object="sv:clear_list_action" role="HbMenu:addAction"/>
+            <ref object="loudspeaker_action" role="HbMenu:addAction"/>
+            <ref object="exit_action" role="HbMenu:addAction"/>
+        </widget>
+        <widget name="sv:toolbar" role="HbView:toolBar" type="HbToolBar">
+            <enums name="orientation" value="Horizontal"/>
+            <ref object="sv:local_stations_button" role="HbToolBar:addAction"/>
+            <ref object="sv:favorite_stations_button" role="HbToolBar:addAction"/>
+        </widget>
+        <widget name="content" role="HbView:widget" type="HbWidget">
+            <widget name="sv:heading_banner" plugin="radiowidgetsplugin" type="RadioBannerLabel">
+                <sizehint height="30" type="MAXIMUM"/>
+                <string name="plainText" locid="txt_rad_subhead_all_stations" />
+            </widget>
+            <widget name="sv:stacked_widget" type="HbWidget">
+                <widget name="sv:scan_button" type="HbPushButton">
+                    <bool name="visible" value="TRUE"/>
+                </widget>
+                <widget name="sv:empty_container" type="HbWidget">
+                    <bool name="visible" value="FALSE"/>
+                    <widget name="sv:empty_title" type="HbLabel">
+                        <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+                        <string locid="txt_rad_info_no_stations" name="plainText"/>
+                        <fontspec name="fontSpec" role="Title" textheight="33.5"/>
+                    </widget>
+                    <widget name="sv:empty_text" type="HbLabel">
+                        <enums name="textWrapping" value="TextWordWrap"/>
+                        <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+                        <sizehint height="320" type="PREFERRED" width="240"/>
+                        <string locid="txt_rad_info_no_stations_search_stations_automat" name="plainText"/>
+                        <fontspec name="fontSpec" role="Title" textheight="33.5"/>
+                    </widget>
+                    <layout orientation="Vertical" spacing="var(hb-param-margin-gene-middle-vertical)" type="linear">
+                        <contentsmargins bottom="var(hb-param-margin-gene-bottom)" left="var(hb-param-margin-gene-left)" right="var(hb-param-margin-gene-right)" top="var(hb-param-margin-gene-top)"/>
+                        <stretchitem stretchfactor="2"/>
+                        <linearitem itemname="sv:empty_title"/>
+                        <stretchitem stretchfactor="1"/>
+                        <linearitem itemname="sv:empty_text"/>
+                        <stretchitem stretchfactor="2"/>
+                    </layout>
+                </widget>
+                <widget name="sv:stations_list" type="HbListView">
+                    <sizehint height="320" type="PREFERRED" width="240"/>
+                    <bool name="visible" value="TRUE"/>
+                </widget>
+                <layout type="stacked">
+                    <stackitem itemname="sv:scan_button"/>
+                    <stackitem itemname="sv:empty_container"/>
+                    <stackitem itemname="sv:stations_list"/>
+                </layout>
+            </widget>
+            <layout type="anchor">
+                <anchoritem dst="sv:heading_banner" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
+                <anchoritem dst="sv:heading_banner" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+                <anchoritem dst="sv:heading_banner" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+                <anchoritem dst="sv:stacked_widget" dstEdge="TOP" spacing="0un" src="sv:heading_banner" srcEdge="BOTTOM"/>
+                <anchoritem dst="sv:stacked_widget" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+                <anchoritem dst="sv:stacked_widget" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+                <anchoritem dst="sv:stacked_widget" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
+            </layout>
+        </widget>
+        <string name="title" locid="txt_rad_title_fm_radio"/>
+    </widget>
+    <connect receiver="view" sender="sv:scan_action" signal="triggered()" slot="startScanning()"/>
+    <connect receiver="view" sender="sv:scan_button" signal="clicked()" slot="startScanning()"/>
+    <connect receiver="view" sender="exit_action" signal="triggered()" slot="quit()"/>
+    <connect receiver="view" sender="sv:stations_list" signal="pressed(QModelIndex)" slot="listItemClicked(QModelIndex)"/>
+    <connect receiver="view" sender="sv:stations_list" signal="longPressed(HbAbstractViewItem*,const QPointF)" slot="listItemLongPressed(HbAbstractViewItem*,const QPointF)"/>
+    <connect receiver="sv:favorite_stations_button" sender="sv:local_stations_button" signal="triggered()" slot="toggle()"/>
+    <connect receiver="sv:local_stations_button" sender="sv:favorite_stations_button" signal="triggered()" slot="toggle()"/>
+
+    <widget name="sv:context_menu" type="HbMenu">
+        <ref object="sv:play_action" role="HbMenu:addAction" />
+        <ref object="sv:rename_action" role="HbMenu:addAction" />
+        <ref object="sv:toggle_favorite_action" role="HbMenu:addAction" />
+        <ref object="sv:delete_action" role="HbMenu:addAction" />
+    </widget>
+    <connect receiver="view" sender="sv:rename_action" signal="triggered()" slot="rename()"/>
+    <connect receiver="view" sender="sv:toggle_favorite_action" signal="triggered()" slot="toggleFavorite()"/>
+    <connect receiver="view" sender="sv:delete_action" signal="triggered()" slot="deleteStation()"/>
+
+    <section name="show_scan_text">
+        <widget name="sv:stations_list">
+            <bool name="visible" value="FALSE"/>
+        </widget>
+        <widget name="sv:empty_container">
+            <bool name="visible" value="TRUE"/>
+        </widget>
+    </section>
+    <section name="hide_scan_text">
+        <widget name="sv:stations_list">
+            <bool name="visible" value="TRUE"/>
+        </widget>
+        <widget name="sv:empty_container">
+            <bool name="visible" value="FALSE"/>
+        </widget>
+    </section>
+    <section name="show_all_stations">
+        <object name="sv:local_stations_button">
+            <bool name="checked" value="TRUE"/>
+        </object>
+        <object name="sv:favorite_stations_button">
+            <bool name="checked" value="FALSE"/>
+        </object>
+        <widget name="sv:heading_banner">
+            <string name="plainText" locid="txt_rad_subhead_all_stations" />
+        </widget>
+        <widget name="sv:scan_button">
+            <bool name="visible" value="TRUE"/>
+        </widget>
+        <widget name="sv:empty_title">
+            <string name="plainText" locid="txt_rad_info_no_stations" />
+        </widget>
+        <widget name="sv:empty_text">
+            <string name="plainText" locid="txt_rad_info_no_stations_search_stations_automat" />
+        </widget>
+    </section>
+    <section name="show_favorites">
+        <object name="sv:local_stations_button">
+            <bool name="checked" value="FALSE"/>
+        </object>
+        <object name="sv:favorite_stations_button">
+            <bool name="checked" value="TRUE"/>
+        </object>
+        <widget name="sv:heading_banner">
+            <string name="plainText" locid="txt_rad_subhead_favorite_stations" />
+        </widget>
+        <widget name="sv:scan_button">
+            <bool name="visible" value="FALSE"/>
+        </widget>
+        <widget name="sv:empty_title">
+            <string name="plainText" locid="txt_rad_info_no_favourite_stations" />
+        </widget>
+        <widget name="sv:empty_text">
+            <string name="plainText" locid="txt_rad_info_no_favourites_add_favourites_to_see" />
+        </widget>
+    </section>
+    <metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
+        <uistate name="Common ui state" sections="#common"/>
+    </metadata>
+</hbdocument>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/src/radiobannerlabel.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "radiobannerlabel.h"
+
+#include <QPainter>
+
+/*!
+ *
+ */
+RadioBannerLabel::RadioBannerLabel( QGraphicsItem * parent ) :
+    HbLabel( parent )
+{
+    QFont currentfont( font() );
+    currentfont.setBold( true );
+    currentfont.setPixelSize( 18 );
+    setFont( currentfont );
+}
+
+/*!
+ *
+ */
+void RadioBannerLabel::paint( QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget )
+{
+    painter->setPen(QPen(QColor(200, 200, 200, 150)));
+    painter->setBrush(QBrush(QColor(200, 200, 200, 150),Qt::SolidPattern));
+    painter->drawRect(option->rect);
+    HbLabel::paint( painter, option, widget );
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/src/radiofadinglabel.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,137 @@
+/*
+* 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:
+*
+*/
+
+// System includes
+
+// User includes
+#include "radiofadinglabel.h"
+#include "radiologger.h"
+#include "radiouiutilities.h"
+
+// Constants
+const QString KHideEffect = "hide";
+const QString KShowEffect = "show";
+
+#ifdef USE_DEPRECATED_ORBIT_APIS
+#   define SET_CONTENT setText
+#   define GET_CONTENT text
+#else
+#   define SET_CONTENT setHtml
+#   define GET_CONTENT html
+#endif // USE_DEPRECATED_ORBIT_APIS
+
+/*!
+ *
+ */
+RadioFadingLabel::RadioFadingLabel( QGraphicsItem* parent ) :
+    HbLabel( parent ),
+    mFadingEnabled( false )
+{
+    QEffectList effectList;
+//    effectList.append( EffectInfo( this, ":/effects/fade_in.fxml", KShowEffect ) );
+//    effectList.append( EffectInfo( this, ":/effects/fade_out.fxml", KHideEffect ) );
+    RadioUiUtilities::addEffects( effectList );
+}
+
+/*!
+ *
+ */
+void RadioFadingLabel::setFadingEnabled( bool fading )
+{
+    mFadingEnabled = fading;
+}
+
+/*!
+ *
+ */
+void RadioFadingLabel::setTextWithoutFading( const QString& newText )
+{
+    HbLabel::SET_CONTENT( trimHtml( newText ) );
+    if ( newText.isEmpty() && mFadingEnabled ) {
+        setOpacity( 0.0 );
+    }
+}
+
+/*!
+ * Public slot
+ *
+ */
+void RadioFadingLabel::setText( const QString& newText )
+{
+    if( GET_CONTENT().compare( newText ) != 0 &&                   // Text is different
+            parentItem() && parentItem()->isVisible() &&    // Parent is visible
+            mFadingEnabled ) {                              // Fading is enabled
+        if ( newText.isEmpty() ) {
+            if ( isVisible() ) {
+                mTextHolder = "";
+                startEffect( KHideEffect, "effectFinished" );
+            }
+        } else {
+            if ( GET_CONTENT().isEmpty() ) {
+                HbLabel::SET_CONTENT( trimHtml( newText ) );
+                startEffect( KShowEffect );
+            } else {
+                mTextHolder = newText;
+                startEffect( KHideEffect, "effectFinished" );
+            }
+        }
+    } else {
+        HbLabel::SET_CONTENT( trimHtml( newText ) );
+    }
+}
+
+/*!
+ * Private slot
+ *
+ */
+void RadioFadingLabel::effectFinished( HbEffect::EffectStatus status )
+{
+    if ( status.reason == Hb::EffectFinished ) {
+        HbLabel::SET_CONTENT( trimHtml( mTextHolder ) );
+        if ( !mTextHolder.isEmpty() ) {
+            HbEffect::start( this, KShowEffect );
+        }
+        mTextHolder = "";
+    }
+}
+
+/*!
+ *
+ */
+void RadioFadingLabel::startEffect( const QString& effectName, const char* slot )
+{
+    if ( HbEffect::effectRunning( this ) ) {
+        HbEffect::cancel( this );
+    }
+    if ( slot ) {
+        HbEffect::start( this, effectName, this, slot );
+    } else {
+        HbEffect::start( this, effectName );
+    }
+}
+
+/*!
+ *
+ */
+QString RadioFadingLabel::trimHtml( const QString& text )
+{
+#ifdef USE_DEPRECATED_ORBIT_APIS
+    return text;
+#else
+    return "<font color=\"white\">" + text + "</font>";
+#endif // USE_DEPRECATED_ORBIT_APIS
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/src/radiofrequencyitem.cpp	Fri Jun 04 10:21:36 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:
+*
+*/
+
+// System includes
+
+// User includes
+#include "radiofrequencyitem.h"
+#include "radiofrequencystrip.h"
+#include "radio_global.h"
+
+/*!
+ *
+ */
+RadioFrequencyItem::RadioFrequencyItem( QString frequency ) :
+    mFrequency( frequency.isEmpty() ? 0 : frequency.toInt() * KOneHertz ),
+    mGraphicsItem( 0 )
+{
+}
+
+/*!
+ *
+ */
+uint RadioFrequencyItem::frequency() const
+{
+    return mFrequency;
+}
+
+/*!
+ *
+ */
+QPixmap RadioFrequencyItem::updatePrimitive( QGraphicsPixmapItem* item )
+{
+    mGraphicsItem = item;
+    return mPixmap;
+}
+
+/*!
+ *
+ */
+void RadioFrequencyItem::setPixmap( QPixmap pixmap )
+{
+    mPixmap = pixmap;
+    if ( mGraphicsItem ) {
+        mGraphicsItem->setPixmap( mPixmap );
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/src/radiofrequencyscanner.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,227 @@
+/*
+* 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:
+*
+*/
+
+// System includes
+#include <HbProgressDialog>
+#include <QTimer>
+#include <HbLabel>
+#include <HbPushButton>
+
+// User includes
+#include "radiofrequencyscanner.h"
+#include "radioscannerengine.h"
+#include "radiouiengine.h"
+#include "radiologger.h"
+#include "radiostationmodel.h"
+#include "radiofrequencystrip.h"
+#include "radiostationcarousel.h"
+#include "radiouiutilities.h"
+#include "radiomainview.h"
+
+// Constants
+const int KExtraRoomToMaxValue = 100000;
+
+/*!
+ *
+ */
+RadioFrequencyScanner::RadioFrequencyScanner( RadioUiEngine& uiEngine, QObject* parent ) :
+    QObject( parent ),
+    mUiEngine( uiEngine ),
+    mInMainView( parent->metaObject()->className() == RadioMainView::staticMetaObject.className() ),
+    mScannerEngine( mUiEngine.scannerEngine() ),
+    mStripScrollTime( 0 ),
+    mCarouselScrollTime( 0 ),
+    mIsAlive( false )
+{
+    RadioUiUtilities::setFrequencyScanner( this );
+}
+
+/*!
+ *
+ */
+RadioFrequencyScanner::~RadioFrequencyScanner()
+{
+}
+
+/*!
+ *
+ */
+void RadioFrequencyScanner::startScanning()
+{
+    mIsAlive = true;
+    RadioFrequencyStrip* frequencyStrip = RadioUiUtilities::frequencyStrip();
+    RadioStationCarousel* carousel = RadioUiUtilities::carousel();
+
+    if ( mInMainView ) {
+        mStripScrollTime = frequencyStrip->autoScrollTime();
+        mCarouselScrollTime = carousel->autoScrollTime();
+
+        carousel->setScanningMode( true );
+        carousel->setAutoScrollTime( 1000 );
+        frequencyStrip->setAutoScrollTime( 1100 );
+
+        connectAndTest( carousel,               SIGNAL(scanAnimationFinished()),
+                        this,                   SLOT(continueScanning()) );
+
+        static_cast<RadioMainView*>( parent() )->setScanningMode( true );
+        frequencyStrip->setScanningMode( true );
+    } else {
+        carousel->setCarouselModel( NULL );
+
+        mScanningProgressNote.reset( new HbProgressDialog( HbProgressDialog::ProgressDialog ) ),
+        mScanningProgressNote->setModal( true );
+        mScanningProgressNote->setAutoClose( true );
+
+        // Add some extra to the maximum value to allow room for the station at the low band edge
+        mScanningProgressNote->setRange( mUiEngine.minFrequency(), mUiEngine.maxFrequency() + KExtraRoomToMaxValue );
+        mScanningProgressNote->setProgressValue( mUiEngine.minFrequency() );
+        mScanningProgressNote->setText( hbTrId( "txt_rad_info_searching_local_stations_please_wait" ) );
+        mScanningProgressNote->show();
+
+        connectAndTest( mScanningProgressNote.data(),   SIGNAL(cancelled()),
+                        this,                           SLOT(cancelScanning()) );
+    }
+
+    connectAndTest( mScannerEngine.data(),  SIGNAL(stationFound(RadioStation)),
+                    this,                   SLOT(updateScanProgress(RadioStation)) );
+
+    QTimer::singleShot( 1000, this, SLOT(delayedStart()) );
+}
+
+/*!
+ *
+ */
+bool RadioFrequencyScanner::isAlive() const
+{
+    return mIsAlive;
+}
+
+/*!
+ * Public slot
+ *
+ */
+void RadioFrequencyScanner::cancelScanning()
+{
+    finishScanning();
+}
+
+/*!
+ * Private slot
+ *
+ */
+void RadioFrequencyScanner::delayedStart()
+{
+    mScannerEngine->startScanning();
+}
+
+/*!
+ * Private slot
+ *
+ */
+void RadioFrequencyScanner::updateScanProgress( const RadioStation& station )
+{
+    if ( !station.isValid() ) {
+        finishScanning();
+        return;
+    }
+
+    const uint frequency = station.frequency();
+    LOG_FORMAT( "RadioFrequencyScanner::updateScanAndSaveProgress frequency: %d", frequency );
+
+    if ( mInMainView ) {
+
+        RadioUiUtilities::frequencyStrip()->setFrequency( frequency, TuneReason::StationScan );
+        RadioUiUtilities::carousel()->animateNewStation( station );
+
+    } else {
+        // Check for special case that can happen during scanning.
+        // If there is a valid radio station at the low frequency band edge it will be reported last after
+        // all of the higher frequencies. We don't update the progress value here because the value would
+        // be lower than the previous one. The progress value is set to maximum when the scanner finishes.
+        if ( frequency != mUiEngine.minFrequency() ) {
+            mScanningProgressNote->setProgressValue( frequency );
+        }
+
+        mScannerEngine->continueScanning();
+    }    
+}
+
+/*!
+ * Private slot
+ *
+ */
+void RadioFrequencyScanner::continueScanning()
+{
+    mScannerEngine->continueScanning();
+}
+
+/*!
+ * Private slot
+ *
+ */
+void RadioFrequencyScanner::restoreUiControls()
+{
+    if ( mInMainView ) {
+        RadioUiUtilities::frequencyStrip()->setScanningMode( false );
+        static_cast<RadioMainView*>( parent() )->setScanningMode( false );
+        RadioUiUtilities::carousel()->setScanningMode( false );
+    }
+
+    deleteLater();
+}
+
+/*!
+ *
+ */
+void RadioFrequencyScanner::finishScanning()
+{
+    mScannerEngine->cancel();
+    RadioUiUtilities::setFrequencyScanner( NULL );
+    mIsAlive = false;
+    RadioFrequencyStrip* frequencyStrip = RadioUiUtilities::frequencyStrip();
+    RadioStationCarousel* carousel = RadioUiUtilities::carousel();
+
+    if ( mInMainView ) {
+        RadioStationModel& model = mUiEngine.stationModel();
+
+        // Scroll the carousel and frequency strip through all of the scanned stations
+        const int stationCount = model.rowCount();
+        if ( stationCount > 1 ) {
+            frequencyStrip->setAutoScrollTime( 1000 );
+            carousel->setAutoScrollTime( 1000 );
+            const uint frequency = model.data( model.index( 0, 0 ), RadioStationModel::RadioStationRole ).value<RadioStation>().frequency();
+            frequencyStrip->setFrequency( frequency, TuneReason::StationScan );
+            carousel->setFrequency( frequency, TuneReason::StationScan );
+
+            frequencyStrip->setAutoScrollTime( mStripScrollTime );
+            carousel->setAutoScrollTime( mCarouselScrollTime );
+        }
+
+        QTimer::singleShot( 100, this, SLOT(restoreUiControls()) );
+
+    } else {
+        mScanningProgressNote->setProgressValue( mScanningProgressNote->maximum() );
+        deleteLater();
+
+        carousel->setCarouselModel( mUiEngine.carouselModel() );
+    }
+
+    disconnect( mScannerEngine.data(),  SIGNAL(stationFound(RadioStation)),
+                this,                   SLOT(updateScanAndSaveProgress(RadioStation)) );
+
+    emit frequencyScannerFinished();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/src/radiofrequencystrip.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,768 @@
+/*
+* 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:
+*
+*/
+
+// System includes
+#include <QPainter>
+#include <QStringListModel>
+#include <QGraphicsSceneResizeEvent>
+#include <QPen>
+#include <HbPushButton>
+#include <QTimer>
+#include <HbColorScheme>
+#include <HbEvent>
+#include <HbSwipeGesture>
+
+#include "radiofrequencystrip.h"
+#include "radiofrequencyitem.h"
+#include "radiouiengine.h"
+#include "radiostation.h"
+#include "radiostationmodel.h"
+#include "radiouiutilities.h"
+#include "radiologger.h"
+
+// Frequency lines
+const int KTabHeightSmall = 10;
+const int KTabHeightBig = 15;
+const int KTabWidthFavorite = 4;
+const qreal KIndicatorWidth = 2.0;
+
+const qreal KRounder = 0.5;
+const int KSelectorWidth = 2;
+const int KSelectorZPos = 100;
+
+const int KHalfHertz = KOneHertz / 2;
+const int KOneTabDistance = 15;
+const uint KOneTabInHz = 0.2 * KOneHertz;
+const qreal KPixelInHz = KOneTabInHz / KOneTabDistance;
+const int KWidth = KOneTabDistance * 5;
+//const int KPixmapWidth = KWidth + KOneTabDistance;
+const int KHeight = 50;                 //TODO: Remove hardcoding
+
+const int K100Khz = 100000;
+
+const char* KSlideToLeft        = "SlideToLeft";
+const char* KSlideFromLeft      = "SlideFromLeft";
+const char* KSlideToRight       = "SlideToRight";
+const char* KSlideFromRight     = "SlideFromRight";
+const char* LEFT_BUTTON         = "tv:left_button";
+const char* RIGHT_BUTTON        = "tv:right_button";
+
+const char* TEXT_COLOR_ATTRIBUTE = "text";
+const int BUTTON_HIDE_TIMEOUT = 500;
+const int BUTTON_SHOW_TIMEOUT = 1000;
+
+/*!
+ *
+ */
+static QLineF makeTab( qreal pos, int height )
+{
+    return QLineF( pos, KHeight - height, pos, KHeight );
+}
+
+/*!
+ *
+ */
+RadioFrequencyStrip::RadioFrequencyStrip() :
+    RadioStripBase(),
+    mUiEngine( NULL ),
+    mMinFrequency( 87500000 ),
+    mMaxFrequency( 108000000 ),
+    mFrequencyStepSize( 100000 ),
+    mFrequency( 87500000 ),
+    mSelectorImage( new QGraphicsPixmapItem( this ) ),
+    mSeparatorPos( 0.0 ),
+    mMaxWidth( 0 ),
+    mSelectorPos( 0.0 ),
+    mLeftButton( new HbPushButton( this ) ),
+    mRightButton( new HbPushButton( this ) ),
+    mButtonTimer( NULL ),
+    mButtonsVisible( true ),
+    mUserIsScrolling( false ),
+    mForegroundColor( Qt::white )//HbColorScheme::color( TEXT_COLOR_ATTRIBUTE ) )
+{
+    RadioUiUtilities::setFrequencyStrip( this );
+
+    setScrollingStyle( HbScrollArea::Pan );
+    setItemSize( QSizeF( KWidth, KHeight ) );
+    setFrictionEnabled( true );
+
+    initModel();
+
+    initSelector();
+
+    initButtons();
+
+    initEmptyItems();
+
+    mFrequency = RadioUiEngine::lastTunedFrequency();
+    scrollToFrequency( mFrequency, 0 );
+}
+
+/*!
+ *
+ */
+void RadioFrequencyStrip::setLeftButtonIcon( const HbIcon& leftButtonIcon )
+{
+    mLeftButtonIcon = leftButtonIcon;
+    if ( mLeftButton ) {
+        mLeftButtonIcon.setColor( Qt::white );
+        mLeftButton->setIcon( mLeftButtonIcon );
+    }
+}
+
+/*!
+ *
+ */
+HbIcon RadioFrequencyStrip::leftButtonIcon() const
+{
+    return mLeftButtonIcon;
+}
+
+/*!
+ *
+ */
+void RadioFrequencyStrip::setRightButtonIcon( const HbIcon& rightButtonIcon )
+{
+    mRightButtonIcon = rightButtonIcon;
+    if ( mRightButton ) {
+        mRightButtonIcon.setColor( Qt::white );
+        mRightButton->setIcon( mRightButtonIcon );
+    }
+}
+
+/*!
+ *
+ */
+HbIcon RadioFrequencyStrip::rightButtonIcon() const
+{
+    return mRightButtonIcon;
+}
+
+/*!
+ *
+ */
+void RadioFrequencyStrip::init( RadioUiEngine* engine )
+{
+    mUiEngine = engine;
+    mMinFrequency       = mUiEngine->minFrequency();
+    mMaxFrequency       = mUiEngine->maxFrequency();
+    mFrequencyStepSize  = mUiEngine->frequencyStepSize();
+    mFrequency          = mUiEngine->currentFrequency();
+    scrollToFrequency( mFrequency, 0 );
+
+    mButtonTimer = new QTimer( this );
+    mButtonTimer->setInterval( BUTTON_HIDE_TIMEOUT );
+    mButtonTimer->setSingleShot( true );
+    connectAndTest( mButtonTimer, SIGNAL(timeout()),
+                    this,         SLOT(toggleButtons()) );
+
+    connectAndTest( mLeftButton,    SIGNAL(clicked()),
+                    this,           SLOT(handleLeftButton()) );
+    connectAndTest( mRightButton,   SIGNAL(clicked()),
+                    this,           SLOT(handleRightButton()) );
+    connectAndTest( mLeftButton,    SIGNAL(longPress(QPointF)),
+                    this,           SLOT(handleLongLeftButton()) );
+    connectAndTest( mRightButton,   SIGNAL(longPress(QPointF)),
+                    this,           SLOT(handleLongRightButton()) );
+
+    connectAndTest( this,           SIGNAL(scrollingEnded()),
+                    this,           SLOT(checkIllegalPos()) );
+
+    grabGesture( Qt::SwipeGesture );
+
+    //TODO: Remove. Stepsize hardcoded to 100 Khz in europe region during demo
+    if ( mFrequencyStepSize < K100Khz ) {
+        mFrequencyStepSize = K100Khz;
+    }
+
+    RadioStationModel* stationModel = &mUiEngine->stationModel();
+    connectAndTest( stationModel,   SIGNAL(rowsInserted(QModelIndex,int,int)),
+                    this,           SLOT(updateStation(QModelIndex,int,int)) );
+    connectAndTest( stationModel,   SIGNAL(rowsRemoved(QModelIndex,int,int)),
+                    this,           SLOT(updateStation(QModelIndex,int,int)) );
+    connectAndTest( stationModel,   SIGNAL(modelReset()),
+                    this,           SLOT(initEmptyItems()) );
+
+    initPositions();
+
+    void updateItems();
+}
+
+/*!
+ *
+ */
+void RadioFrequencyStrip::setFrequency( const uint frequency, int reason )
+{
+    LOG_FORMAT( "RadioFrequencyStrip::setFrequency, frequency: %d, reason: %d", frequency, reason );
+    if ( reason != TuneReason::FrequencyStrip &&            // Not sent by the FrequencyStrip
+         frequency != mFrequency &&                         // Different from the current
+         mFrequencies.contains( frequency ) )               // 0 frequency means any illegal value
+    {
+        scrollToFrequency( frequency, mAutoScrollTime );
+        if ( reason != TuneReason::Skip && reason != TuneReason::StationScan ) {
+            emitFrequencyChanged( frequency );
+        }
+    }
+}
+
+/*!
+ *
+ */
+uint RadioFrequencyStrip::frequency() const
+{
+    return mFrequency;
+}
+
+/*!
+ * Public slot
+ *
+ */
+void RadioFrequencyStrip::updateFavorite( const RadioStation& station )
+{
+    LOG_SLOT_CALLER;
+    FrequencyPos pos = mFrequencies.value( station.frequency() );
+    updateFavorites( pos.mItem );
+}
+
+/*!
+ * Public slot
+ *
+ */
+void RadioFrequencyStrip::setScanningMode( bool isScanning )
+{
+    mButtonTimer->stop();
+    if ( isScanning ) {
+        scrollToFrequency( mMinFrequency, mAutoScrollTime );
+        hideButtons();
+    } else {
+        showButtons();
+
+    }
+    setEnabled( !isScanning );
+}
+
+/*!
+ * Private slot
+ *
+ */
+void RadioFrequencyStrip::updateStation( const QModelIndex& parent, int first, int last )
+{
+    Q_UNUSED( parent );
+    RadioStationModel& model = mUiEngine->stationModel();
+    uint frequency = 0;
+    for ( int i = first; i <= last; ++i ) {
+        frequency = model.data( model.index( i, 0, QModelIndex() ),
+                                RadioStationModel::RadioStationRole ).value<RadioStation>().frequency();
+        if ( mFrequencies.contains( frequency ) ) {
+            FrequencyPos pos = mFrequencies.value( frequency );
+            updateFavorites( pos.mItem );
+        }
+    }
+}
+
+/*!
+ * Private slot
+ *
+ */
+void RadioFrequencyStrip::initEmptyItems()
+{
+    LOG_METHOD;
+    QList<RadioStation> emptyList;
+    foreach ( RadioFrequencyItem* item, mFrequencyItems ) {
+        QPixmap pixmap = drawPixmap( item->frequency(), emptyList, item );
+        item->setPixmap( pixmap );
+    }
+}
+
+/*!
+ * Private slot
+ */
+void RadioFrequencyStrip::handleLeftButton()
+{
+    emit skipRequested( StationSkip::PreviousFavorite );
+}
+
+/*!
+ * Private slot
+ */
+void RadioFrequencyStrip::handleLongLeftButton()
+{
+    emit seekRequested( Seeking::Down );
+}
+
+/*!
+ * Private slot
+ */
+void RadioFrequencyStrip::handleRightButton()
+{
+    emit skipRequested( StationSkip::NextFavorite );
+}
+
+/*!
+ * Private slot
+ */
+void RadioFrequencyStrip::handleLongRightButton()
+{
+    emit seekRequested( Seeking::Up );
+}
+
+/*!
+ * Private slot
+ */
+void RadioFrequencyStrip::toggleButtons()
+{
+    if ( mButtonsVisible ) {
+        hideButtons();
+    } else {
+        showButtons();
+    }
+}
+
+/*!
+ * Private slot
+ */
+void RadioFrequencyStrip::checkIllegalPos()
+{
+    // Check if the selector is in the invalid area where the strip loops around
+    const int selectorPosition = selectorPos();
+    if ( !mPositions.contains( selectorPosition ) ) {
+        if ( selectorPosition < mMaxWidth - KWidth + mSeparatorPos ) {
+            scrollToFrequency( mMaxFrequency, 500 );
+            emitFrequencyChanged( mMaxFrequency );
+        } else {
+            scrollToFrequency( mMinFrequency, 500 );
+            emitFrequencyChanged( mMinFrequency );
+        }
+    }
+}
+
+/*!
+ * \reimp
+ */
+void RadioFrequencyStrip::updateItemPrimitive( QGraphicsItem* itemToUpdate, int itemIndex )
+{
+    QGraphicsPixmapItem* item = static_cast<QGraphicsPixmapItem*>( itemToUpdate );
+    if ( itemIndex < mFrequencyItems.count() ) {
+        item->setPixmap( mFrequencyItems.at( itemIndex )->updatePrimitive( item ) );
+    }
+}
+
+/*!
+ * \reimp
+ */
+QGraphicsItem* RadioFrequencyStrip::createItemPrimitive( QGraphicsItem* parent )
+{
+    return new QGraphicsPixmapItem( parent );
+}
+
+/*!
+ * \reimp
+ */
+void RadioFrequencyStrip::scrollPosChanged( QPointF newPosition )
+{
+    Q_UNUSED( newPosition );
+
+    if ( mUserIsScrolling ) {
+        const int pos = selectorPos();
+        emitFrequencyChanged( mPositions.value( pos ) );
+    }
+}
+
+/*!
+ * \reimp
+ */
+void RadioFrequencyStrip::resizeEvent ( QGraphicsSceneResizeEvent* event )
+{
+    LOG_METHOD_ENTER;
+    RadioStripBase::resizeEvent( event );
+
+    mSelectorPos = event->newSize().width() / 2;
+    mSelectorImage->setOffset( mSelectorPos - (KIndicatorWidth / 2), 0.0 );
+
+    const int stripHeight = event->newSize().height();
+    if ( !mLeftButtonIcon.isNull() ) {
+        mLeftButton->resize( stripHeight, stripHeight );
+        mLeftButton->setBackground( mLeftButtonIcon );
+    }
+
+    if ( !mRightButtonIcon.isNull() ) {
+        mRightButton->resize( stripHeight, stripHeight );
+        mRightButton->setBackground( mRightButtonIcon );
+    }
+    mRightButton->setPos( QPointF( size().width() - mRightButton->size().width(), 0 ) );
+
+    scrollToFrequency( mFrequency, 0 );
+}
+
+/*!
+ * \reimp
+ */
+void RadioFrequencyStrip::showEvent( QShowEvent* event )
+{
+    Q_UNUSED( event );
+    scrollToFrequency( mFrequency, 0 );
+}
+
+/*!
+ * \reimp
+ */
+void RadioFrequencyStrip::changeEvent( QEvent* event )
+{
+    if ( event->type() == HbEvent::ThemeChanged ) {
+        // Update the foreground color and redraw each item
+        mForegroundColor = Qt::white;// HbColorScheme::color( TEXT_COLOR_ATTRIBUTE );
+        updateItems();
+    }
+
+    return HbWidgetBase::changeEvent(event);
+}
+
+/*!
+ * \reimp
+ */
+void RadioFrequencyStrip::mousePressEvent( QGraphicsSceneMouseEvent* event )
+{
+    RadioStripBase::mousePressEvent( event );
+    mUserIsScrolling = true;
+    mButtonTimer->stop();
+    mButtonTimer->start( BUTTON_HIDE_TIMEOUT );
+}
+
+/*!
+ * \reimp
+ */
+void RadioFrequencyStrip::mouseReleaseEvent( QGraphicsSceneMouseEvent* event )
+{
+    mUserIsScrolling = false;
+    RadioStripBase::mouseReleaseEvent( event );
+
+//    if ( !mIsPanGesture ) {
+//        const qreal touchDelta = event->pos().x() - mSelectorPos;
+//        const int touchPos = selectorPosition + touchDelta;
+//        const uint frequencyAtPos = mPositions.value( touchPos );
+//
+//        uint foundFrequency = 0;
+//        for ( int i = 0; i < 10; ++i ) {
+//            const uint delta = i * mFrequencyStepSize;
+//            FrequencyPos leftFreq = mFrequencies.value( frequencyAtPos - delta );
+//            FrequencyPos rightFreq = mFrequencies.value( frequencyAtPos + delta );
+//
+//            if ( touchPos - leftFreq.mPosition > KTouchPosThreshold ) {
+//                break;
+//            }
+//
+//            if ( leftFreq.mFavorite || leftFreq.mLocalStation ) {
+//                foundFrequency = frequencyAtPos - delta;
+//                break;
+//            } else if ( rightFreq.mFavorite || rightFreq.mLocalStation ) {
+//                foundFrequency = frequencyAtPos + delta;
+//                break;
+//            }
+//        }
+//
+//        if ( foundFrequency > 0 ) {
+//            setFrequency( foundFrequency, 0 );
+//        }
+//    }
+
+    mButtonTimer->stop();
+    if ( !mButtonsVisible ) {
+        mButtonTimer->start( BUTTON_SHOW_TIMEOUT );
+    }
+}
+
+/*!
+ * \reimp
+ */
+void RadioFrequencyStrip::gestureEvent( QGestureEvent* event )
+{
+    if ( HbSwipeGesture* gesture = static_cast<HbSwipeGesture*>( event->gesture( Qt::SwipeGesture ) ) ) {
+        if ( gesture->state() == Qt::GestureFinished ) {
+            if ( gesture->horizontalDirection() == QSwipeGesture::Left ) {
+                emit skipRequested( StationSkip::Next );
+            } else if ( gesture->horizontalDirection() == QSwipeGesture::Right ) {
+                emit skipRequested( StationSkip::Previous );
+            }
+        }
+    } else {
+        RadioStripBase::gestureEvent( event );
+    }
+}
+
+/*!
+ *
+ */
+void RadioFrequencyStrip::initModel()
+{
+    const uint minFreq = uint( qreal(mMinFrequency) / KOneHertz + KRounder );
+    const uint maxFreq = uint( qreal(mMaxFrequency) / KOneHertz + 0.9 ); // always round up
+
+    QStringList list;
+    QString freqText;
+    for ( uint i = minFreq; i <= maxFreq; ++i ) {
+        freqText = QString::number( i );
+        list.append( freqText );
+        mFrequencyItems.append( new RadioFrequencyItem( freqText ) );
+    }
+    mFrequencyItems.append( new RadioFrequencyItem( "" ) );
+    list.append( "" );
+
+    mMaxWidth = list.count() * KWidth;
+
+    mSeparatorPos = qreal(KWidth) / 2;
+    const uint minDrawableFreq = minFreq * KOneHertz - KHalfHertz;;
+    const uint maxDrawableFreq = maxFreq * KOneHertz + KHalfHertz;
+    mSeparatorPos += qreal( ( mMinFrequency  - minDrawableFreq ) / 2 ) / KPixelInHz;
+    mSeparatorPos -= qreal( ( maxDrawableFreq - mMaxFrequency ) / 2 ) / KPixelInHz;
+
+    setModel( new QStringListModel( list, this ) );
+}
+
+/*!
+ *
+ */
+void RadioFrequencyStrip::initSelector()
+{
+    QPixmap selectorPixmap = QPixmap( QSize( KSelectorWidth, KHeight ) );
+    selectorPixmap.fill( Qt::red );
+    mSelectorImage->setPixmap( selectorPixmap );
+    mSelectorImage->setZValue( KSelectorZPos );
+}
+
+/*!
+ *
+ */
+void RadioFrequencyStrip::initPositions()
+{
+    int prevPos = 0;
+    int nextPos = 0;
+    const int lastPos = mFrequencies.value( mMaxFrequency ).mPosition;
+    for ( int i = mFrequencies.value( mMinFrequency ).mPosition; i < lastPos; ++i ) {
+        if ( mPositions.contains( i ) ) {
+            prevPos = i;
+            const uint freq = mPositions.value( prevPos ) + mFrequencyStepSize;
+            if ( mFrequencies.contains( freq ) ) {
+                nextPos = mFrequencies.value( freq ).mPosition;
+            } else {
+                nextPos = prevPos;
+            }
+        } else {
+            const int nearestHit = ( i - prevPos ) < ( nextPos - i ) ? prevPos : nextPos;
+            mPositions.insert( i, mPositions.value( nearestHit ) );
+        }
+    }
+}
+
+/*!
+ *
+ */
+void RadioFrequencyStrip::initButtons()
+{
+    mLeftButton->setZValue( KSelectorZPos );
+    mLeftButton->setObjectName( LEFT_BUTTON );
+    mRightButton->setZValue( KSelectorZPos );
+    mRightButton->setObjectName( RIGHT_BUTTON );
+
+    QEffectList effectList;
+    effectList.append( EffectInfo( mLeftButton, ":/effects/slide_to_left.fxml", KSlideToLeft ) );
+    effectList.append( EffectInfo( mLeftButton, ":/effects/slide_from_left.fxml", KSlideFromLeft ) );
+    effectList.append( EffectInfo( mRightButton, ":/effects/slide_to_right.fxml", KSlideToRight ) );
+    effectList.append( EffectInfo( mRightButton, ":/effects/slide_from_right.fxml", KSlideFromRight ) );
+    RadioUiUtilities::addEffects( effectList );
+}
+
+/*!
+ *
+ */
+void RadioFrequencyStrip::addFrequencyPos( int pos, uint frequency, RadioFrequencyItem* item )
+{
+    mFrequencies.insert( frequency, FrequencyPos( pos, item ) );
+    mPositions.insert( pos, frequency );
+}
+
+/*!
+ *
+ */
+void RadioFrequencyStrip::updateFavorites( RadioFrequencyItem* item )
+{
+    if ( item ) {
+        uint frequency = item->frequency();
+        QList<RadioStation> stations;
+        if ( mUiEngine ) {
+            stations = mUiEngine->stationsInRange( frequency - KHalfHertz, frequency + KHalfHertz );
+        }
+
+        QPixmap pixmap = drawPixmap( frequency, stations, item );
+        item->setPixmap( pixmap );
+
+        foreach ( const RadioStation& station, stations ) {
+            frequency = station.frequency();
+            FrequencyPos pos = mFrequencies.value( frequency );
+            mFrequencies.insert( frequency, pos );
+        }
+    }
+}
+
+/*!
+ *
+ */
+void RadioFrequencyStrip::updateItems()
+{
+    foreach ( RadioFrequencyItem* item, mFrequencyItems ) {
+        updateFavorites( item );
+    }
+}
+
+/*!
+ *
+ */
+QPixmap RadioFrequencyStrip::drawPixmap( uint frequency, QList<RadioStation> stations, RadioFrequencyItem* item )
+{
+    QPixmap pixmap( KWidth, KHeight );
+    pixmap.fill( Qt::transparent );
+    QPainter painter( &pixmap );
+    QPen normalPen = painter.pen();
+    QPen favoritePen = normalPen;
+    normalPen.setColor( mForegroundColor );
+    painter.setPen( normalPen );
+
+    if ( frequency == 0 ) {
+        painter.drawLine( makeTab( mSeparatorPos - 1 + KRounder, KHeight ) );
+        painter.drawLine( makeTab( mSeparatorPos + KRounder, KHeight ) );
+        return pixmap;
+    }
+
+    const QString itemText = QString::number( frequency / KOneHertz );
+    const uint startFrequency = frequency - KHalfHertz;
+    const uint endFrequency = startFrequency + KOneHertz;
+    const uint  roundedMin = int( qreal(mMinFrequency) / KOneHertz + KRounder );
+    const uint freq = frequency / KOneHertz;
+    const int diff = freq - roundedMin;
+    const qreal startPixel = diff * KWidth;
+    qreal pixels = 0.0;
+    QFont painterFont = painter.font();
+    painterFont.setPointSize( 6 );
+    painter.setFont( painterFont );
+
+    const int charWidth = painter.fontMetrics().averageCharWidth();
+    for ( uint frequency = startFrequency; frequency <= endFrequency; frequency += mFrequencyStepSize ) {
+
+        if ( frequency < mMinFrequency || frequency > mMaxFrequency ) {
+            continue;
+        }
+
+        pixels = qreal( frequency - startFrequency ) / KPixelInHz;
+        if ( frequency % KOneHertz == 0 ) {
+
+            // Draw the high frequency tab and the frequency text for the even number
+            painter.drawLine( makeTab( pixels, KTabHeightBig ) );
+            const int textPosX = pixels - itemText.length() * charWidth / 2;
+            painter.drawText( QPoint( textPosX, 20 ), itemText );
+
+        } else if ( frequency % KOneTabInHz == 0 ) {
+
+            // Draw the low frequency tab for the uneven number
+            painter.drawLine( makeTab( pixels, KTabHeightSmall ) );
+
+        }
+
+        addFrequencyPos( startPixel + pixels + KRounder, frequency, item );
+    }
+
+    // Draw favorites and local stations
+    favoritePen.setColor( Qt::yellow );
+
+    const int markerYPos = KHeight - 20;
+    foreach ( const RadioStation& station, stations ) {
+        const uint frequency = station.frequency();
+        pixels = qreal( frequency - startFrequency ) / KPixelInHz;
+
+        if ( station.isFavorite() ) {
+            favoritePen.setWidth( KTabWidthFavorite );
+            painter.setPen( favoritePen );
+            painter.drawEllipse( pixels - 3, markerYPos - 3, 6, 6 );
+//            painter.drawPixmap( pixels - 10, 20, 20, 20, mFavoriteIcon.pixmap() );
+        } else if ( station.isType( RadioStation::LocalStation ) ) {
+//            painter.setPen( normalPen );
+//            painter.drawLine( pixels,                           // Start X
+//                              KHeight - KTabHeightFavorite,     // Start Y
+//                              pixels,                           // End X
+//                              KHeight );                        // End Y
+
+            favoritePen.setWidth( 1 );
+            painter.setPen( favoritePen );
+            painter.drawEllipse( pixels - 4, markerYPos - 4, 8, 8 );
+        }
+    }
+
+    return pixmap;
+}
+
+/*!
+ *
+ */
+void RadioFrequencyStrip::emitFrequencyChanged( uint frequency )
+{
+    if ( frequency > 0 && frequency != mFrequency ) {
+        mFrequency = frequency;
+        emit frequencyChanged( frequency, TuneReason::FrequencyStrip );
+    }
+}
+
+/*!
+ *
+ */
+int RadioFrequencyStrip::selectorPos() const
+{
+    const int pos = ( -contentWidget()->x() + mSelectorPos ) + KRounder;
+    return pos % mMaxWidth;
+}
+
+/*!
+ *
+ */
+void RadioFrequencyStrip::scrollToFrequency( uint frequency, int time )
+{
+    // Find the shortest route to the requested frequency.
+    const int pos = ( -contentWidget()->x() + mSelectorPos ) + KRounder;
+    if ( pos >= mMaxWidth - KWidth + mSeparatorPos ) {
+        const qreal newPos = qreal( mFrequencies.value( frequency ).mPosition ) - mSelectorPos + mMaxWidth;
+        scrollContentsTo( QPointF( newPos, 0 ), time );
+    } else {
+        scrollContentsTo( QPointF( qreal( mFrequencies.value( frequency ).mPosition ) - mSelectorPos, 0 ), time );
+    }
+}
+
+/*!
+ *
+ */
+void RadioFrequencyStrip::hideButtons()
+{
+    mButtonsVisible = false;
+    HbEffect::start( mLeftButton, KSlideToLeft );
+    HbEffect::start( mRightButton, KSlideToRight );
+}
+
+/*!
+ *
+ */
+void RadioFrequencyStrip::showButtons()
+{
+    mButtonsVisible = true;
+    HbEffect::start( mLeftButton, KSlideFromLeft );
+    HbEffect::start( mRightButton, KSlideFromRight );
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/src/radiohistoryview.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,315 @@
+/*
+* 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:
+*
+*/
+
+// System includes
+#include <HbListView>
+#include <HbAction>
+#include <HbAbstractViewItem>
+#include <HbMenu>
+#include <HbMessageBox>
+
+// User includes
+#include "radiohistoryview.h"
+#include "radiowindow.h"
+#include "radiologger.h"
+#include "radiouiloader.h"
+#include "radiouiengine.h"
+#include "radiohistorymodel.h"
+#include "radiohistoryitem.h"
+
+// BEGIN TEMPORARY TEST CODE CODE
+#include <QTimer>
+#include "radiostationmodel.h"
+
+struct Song
+{
+    const char* mArtist;
+    const char* mTitle;
+};
+const Song KRecognizedSongs[] = {
+    { "Red Hot Chili Peppers", "Under The Bridge" },
+    { "Queens Of The Stone Age", "No One Knows" },
+    { "The Presidents of the United States of America", "Dune Buggy" },
+    { "System of a Down", "Aerials" },
+    { "The White Stripes", "Seven Nation Army" },
+    { "Alice In Chains", "When The Sun Rose Again" },
+    { "Bullet For My Valentine", "Tears Don't Fall" }
+};
+const int KSongsCount = sizeof( KRecognizedSongs ) / sizeof( KRecognizedSongs[0] );
+// END TEMPORARY TEST CODE CODE
+
+/*!
+ *
+ */
+RadioHistoryView::RadioHistoryView() :
+    RadioViewBase( false ),
+    mHistoryList( 0 ),
+    mAllSongsButton( 0 ),
+    mTaggedSongsButton( 0 ),
+    mSelectedItem( new RadioHistoryItem() ),
+    mCurrentRow( -1 ),
+    mSongIndex( 0 )
+{
+}
+
+/*!
+ *
+ */
+RadioHistoryView::~RadioHistoryView()
+{
+}
+
+/*!
+ *
+ */
+void RadioHistoryView::setNonTaggedIcon( const HbIcon& nonTaggedIcon )
+{
+    mNonTaggedIcon = nonTaggedIcon;
+    mNonTaggedIcon.setColor( Qt::white );
+}
+
+/*!
+ *
+ */
+HbIcon RadioHistoryView::nonTaggedIcon() const
+{
+    return mNonTaggedIcon;
+}
+
+/*!
+ *
+ */
+void RadioHistoryView::setTaggedIcon( const HbIcon& taggedIcon )
+{
+    mTaggedIcon = taggedIcon;
+}
+
+/*!
+ *
+ */
+HbIcon RadioHistoryView::taggedIcon() const
+{
+    return mTaggedIcon;
+}
+
+/*!
+ * Private slot
+ *
+ */
+void RadioHistoryView::deckButtonPressed()
+{
+    if ( sender() == mTaggedSongsButton ) {
+        loadSection( DOCML::FILE_HISTORYVIEW, DOCML::HV_SECTION_FAVORITE_MODE );
+    } else {
+        loadSection( DOCML::FILE_HISTORYVIEW, DOCML::HV_SECTION_HISTORY_MODE );
+    }
+
+    const bool showTagged = mTaggedSongsButton->isChecked();
+    historyModel().setShowTagged( showTagged );
+
+    updateVisibilities();
+}
+
+/*!
+ * Private slot
+ *
+ */
+void RadioHistoryView::clearList()
+{
+    const bool showingTagged = mTaggedSongsButton->isChecked();
+    askQuestion( hbTrId( showingTagged ? "txt_rad_info_clear_tagged_songs_list" :
+                                         "txt_rad_info_clear_recently_played_songs_list" ) );
+}
+
+/*!
+ * Private slot
+ *
+ */
+void RadioHistoryView::updateVisibilities()
+{
+    const int itemCount = mMainWindow->uiEngine().historyModel().rowCount();
+    loadSection( DOCML::FILE_HISTORYVIEW, itemCount ? DOCML::HV_SECTION_SHOW_LIST : DOCML::HV_SECTION_HIDE_LIST );
+}
+
+/*!
+ * Private slot
+ *
+ */
+void RadioHistoryView::showContextMenu( const QModelIndex& index )
+{
+    *mSelectedItem = historyModel().itemAtIndex( index );
+    mCurrentRow = index.row();
+
+    HbMenu* menu = mUiLoader->findObject<HbMenu>( DOCML::HV_NAME_CONTEXT_MENU );
+
+    if ( HbAction* tagAction = mUiLoader->findObject<HbAction>( DOCML::HV_NAME_CONTEXT_TAG ) ) {
+        if ( mSelectedItem->isTagged() ) {
+            tagAction->setText( hbTrId( "txt_rad_menu_remove_tag" ) );
+        } else {
+            tagAction->setText( hbTrId( "txt_rad_menu_tag_song" ) );
+        }
+    }
+
+    if ( HbAction* searchAction = mUiLoader->findObject<HbAction>( DOCML::HV_NAME_CONTEXT_SEARCH ) ) {
+        //TODO: Check if "search from other store" should be available
+        searchAction->setVisible( false );
+    }
+
+    HbAbstractViewItem* item =  mHistoryList->itemByIndex( index );
+    QPointF coords = item->pos();
+    coords.setY( mHistoryList->contentWidget()->pos().y() + coords.y() );
+    menu->setPreferredPos( QPointF( size().width() / 2 - menu->size().width() / 2, coords.y() + menu->size().height() / 2 ) );
+
+    menu->show();
+}
+
+/*!
+ * Private slot
+ *
+ */
+void RadioHistoryView::toggleTagging()
+{
+    historyModel().toggleTagging( *mSelectedItem, mCurrentRow );
+    mSelectedItem->reset();
+    mCurrentRow = -1;
+}
+
+/*!
+ * Private slot
+ *
+ */
+void RadioHistoryView::openOviStore()
+{
+    QString msg = "To be implemented: Open ovi store. Artist: %1, Title: %2";
+    HbMessageBox::information( msg.arg( mSelectedItem->artist() ).arg( mSelectedItem->title() ) );
+    mMainWindow->uiEngine().openMusicStore( *mSelectedItem );
+}
+
+/*!
+ * Private slot
+ *
+ */
+void RadioHistoryView::openOtherStore()
+{
+    QString msg = "To be implemented: Open other store. Artist: %1, Title: %2";
+    HbMessageBox::information( msg.arg( mSelectedItem->artist() ).arg( mSelectedItem->title() ) );
+    mMainWindow->uiEngine().openMusicStore( *mSelectedItem, RadioUiEngine::OtherStore );
+}
+
+/*!
+ * Private slot
+ * TEMPORARY TEST CODE
+ */
+void RadioHistoryView::addSongs()
+{
+    for ( int i = 0; i < KSongsCount; ++i ) {
+        QTimer::singleShot( 1000 + i * 1500, this, SLOT(addOneSong()) );
+    }
+}
+
+/*!
+ * Private slot
+ * TEMPORARY TEST CODE
+ */
+void RadioHistoryView::addOneSong()
+{
+    Song song = KRecognizedSongs[mSongIndex++];
+    mSongIndex %= KSongsCount;
+
+    RadioStation station = mMainWindow->uiEngine().stationModel().currentStation();
+    mMainWindow->uiEngine().historyModel().addItem( song.mArtist, song.mTitle, station );
+}
+
+/*!
+ * \reimp
+ *
+ */
+void RadioHistoryView::init()
+{
+    LOG_METHOD;
+    mInitialized = true;
+
+    RadioHistoryModel* historyModel = &mMainWindow->uiEngine().historyModel();
+    historyModel->setShowDetails( mOrientation == Qt::Horizontal );
+
+    if ( !mNonTaggedIcon.isNull() && !mTaggedIcon.isNull() ) {
+        historyModel->setIcons( mNonTaggedIcon.qicon(), mTaggedIcon.qicon() );
+    }
+
+    mHistoryList = mUiLoader->findObject<HbListView>( DOCML::HV_NAME_HISTORY_LIST );
+    mHistoryList->setScrollingStyle( HbListView::PanOrFlick );
+    mHistoryList->setModel( historyModel );
+    mHistoryList->setSelectionMode( HbListView::NoSelection );
+    mHistoryList->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
+
+    mAllSongsButton = mUiLoader->findObject<HbAction>( DOCML::HV_NAME_ALL_SONGS_BUTTON );
+    mTaggedSongsButton = mUiLoader->findObject<HbAction>( DOCML::HV_NAME_TAGGED_SONGS_BUTTON );
+
+    if ( HbAction* clearListAction = mUiLoader->findObject<HbAction>( DOCML::HV_NAME_CLEAR_LIST_ACTION ) ) {
+        connectAndTest( clearListAction,    SIGNAL(triggered()),
+                        this,               SLOT(clearList()) );
+    }
+
+    connectAndTest( mTaggedSongsButton,     SIGNAL(triggered() ),
+                    this,                   SLOT(deckButtonPressed() ) );
+    connectAndTest( mAllSongsButton,        SIGNAL(triggered() ),
+                    this,                   SLOT(deckButtonPressed() ) );
+    connectAndTest( historyModel,           SIGNAL(itemAdded() ),
+                    this,                   SLOT(updateVisibilities() ) );
+
+    loadSection( DOCML::FILE_HISTORYVIEW, DOCML::HV_SECTION_HISTORY_MODE );
+    updateVisibilities();
+    
+    connectCommonMenuItem( MenuItem::UseLoudspeaker );
+
+    initBackAction();
+
+    // BEGIN TEMPORARY TEST CODE
+    if ( HbAction* addSongsAction = mUiLoader->findObject<HbAction>( "hv:add_songs_action" ) ) {
+        connectAndTest( addSongsAction,     SIGNAL(triggered()),
+                        this,               SLOT(addSongs()) );
+    }
+    // END TEMPORARY TEST CODE
+}
+
+/*!
+ * \reimp
+ *
+ */
+void RadioHistoryView::setOrientation()
+{
+    RadioHistoryModel& model = mMainWindow->uiEngine().historyModel();
+    model.setShowDetails( mOrientation == Qt::Horizontal );
+}
+
+/*!
+ * \reimp
+ *
+ */
+void RadioHistoryView::userAccepted()
+{
+    mMainWindow->uiEngine().historyModel().removeAll();
+    updateVisibilities();
+}
+
+/*!
+ *
+ */
+RadioHistoryModel& RadioHistoryView::historyModel() const
+{
+    return *static_cast<RadioHistoryModel*>( mHistoryList->model() );
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/src/radiomainview.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,248 @@
+/*
+* 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:
+*
+*/
+
+// System includes
+#include <QTimer>
+#include <HbLabel>
+#include <HbPushButton>
+#include <HbAction>
+
+// User includes
+#include "radiowindow.h"
+#include "radiomainview.h"
+#include "radiofrequencystrip.h"
+#include "radiouiengine.h"
+#include "radiologger.h"
+#include "radiostationcarousel.h"
+#include "radiouiloader.h"
+#include "radiouiutilities.h"
+#include "radiostationmodel.h"
+#include "radiofrequencyscanner.h"
+
+// Constants
+
+/*!
+ *
+ */
+RadioMainView::RadioMainView() :
+    RadioViewBase( false ),
+    mCarousel( NULL ),
+    mFrequencyStrip( NULL )
+{
+}
+
+/*!
+ *
+ */
+RadioMainView::~RadioMainView()
+{
+}
+
+/*!
+ * \reimp
+ *
+ */
+void RadioMainView::setScanningMode( bool scanning )
+{
+    if ( scanning ) {
+        loadSection( DOCML::FILE_MAINVIEW, DOCML::MV_SECTION_SCANNING );
+    } else {
+        loadSection( DOCML::FILE_MAINVIEW, DOCML::MV_SECTION_NORMAL );
+        mFrequencyScanner.take();
+    }
+}
+
+/*!
+ * \reimp
+ *
+ */
+void RadioMainView::init()
+{
+    LOG_METHOD;
+    mInitialized = true;
+    mCarousel = mUiLoader->findObject<RadioStationCarousel>( DOCML::MV_NAME_STATION_CAROUSEL );
+    mCarousel->init( *mUiLoader, &mMainWindow->uiEngine() );
+
+    // Note! UI connections are already made in the DocML file. Here we need to connect UI to engine
+    RadioUiEngine* engine = &mMainWindow->uiEngine();
+    mFrequencyStrip = mUiLoader->findObject<RadioFrequencyStrip>( DOCML::MV_NAME_FREQUENCY_STRIP );
+    mFrequencyStrip->init( engine );
+
+    RadioStationModel* stationModel = &engine->stationModel();
+
+    connectAndTest( mFrequencyStrip,            SIGNAL(frequencyChanged(uint,int)),
+                    this,                       SLOT(setFrequencyFromWidget(uint,int)) );
+    connectAndTest( mCarousel,                  SIGNAL(frequencyChanged(uint,int)),
+                    this,                       SLOT(setFrequencyFromWidget(uint,int)) );
+    connectAndTest( engine,                     SIGNAL(tunedToFrequency(uint,int)),
+                    this,                       SLOT(setFrequencyFromEngine(uint,int)) );
+
+    connectAndTest( mFrequencyStrip,            SIGNAL(skipRequested(int)),
+                    this,                       SLOT(skip(int)) );
+    connectAndTest( mFrequencyStrip,            SIGNAL(seekRequested(int)),
+                    engine,                     SLOT(seekStation(int)) );
+
+    connectAndTest( stationModel,               SIGNAL(favoriteChanged(RadioStation)),
+                    mFrequencyStrip,            SLOT(updateFavorite(RadioStation)) );
+
+    connectAndTest( engine,                     SIGNAL(seekingStarted(int)),
+                    this,                       SLOT(seekingStarted()) );
+    connectAndTest( engine,                     SIGNAL(antennaStatusChanged(bool)),
+                    mCarousel,                  SLOT(updateAntennaStatus(bool)) );
+    connectAndTest( engine,                     SIGNAL(audioRouteChanged(bool)),
+                    this,                       SLOT(updateAudioRoute(bool)) );
+
+    HbPushButton* stationsButton = mUiLoader->findWidget<HbPushButton>( DOCML::MV_NAME_STATIONS_BUTTON );
+    connectAndTest( stationsButton,             SIGNAL(clicked()),
+                    mMainWindow,                SLOT(activateStationsView()) );
+
+    HbPushButton* scanButton = mUiLoader->findWidget<HbPushButton>( DOCML::MV_NAME_SCAN_BUTTON );
+    connectAndTest( scanButton,                 SIGNAL(clicked()),
+                    this,                       SLOT(toggleScanning()) );
+
+    HbPushButton* loudspeakerButton = mUiLoader->findWidget<HbPushButton>( DOCML::MV_NAME_SPEAKER_BUTTON );
+    connectAndTest( loudspeakerButton,          SIGNAL(clicked()),
+                    engine,                     SLOT(toggleAudioRoute()) );
+
+    // "Play history" menu item
+    connectViewChangeMenuItem( DOCML::MV_NAME_HISTORYVIEW_ACTION, SLOT(activateHistoryView()) );
+
+    updateAudioRoute( mMainWindow->uiEngine().isUsingLoudspeaker() );
+
+    // Add "back" navigation action to put the application to background
+    HbAction* backAction = new HbAction( Hb::BackNaviAction, this );
+    connectAndTest( backAction,     SIGNAL(triggered()),
+                    mMainWindow,    SLOT(lower()) );
+    setNavigationAction( backAction );
+
+    const bool firsTimeStart = engine->isFirstTimeStart();
+    const int rowCount = engine->stationModel().rowCount();
+    if ( firsTimeStart && rowCount == 0 ){
+        QTimer::singleShot( 100, this, SLOT(toggleScanning()) );
+    }
+}
+
+/*!
+ * \reimp
+ *
+ */
+void RadioMainView::setOrientation()
+{
+    loadSection( DOCML::FILE_MAINVIEW, mMainWindow->orientationSection() );
+}
+
+/*!
+ * \reimp
+ *
+ */
+void RadioMainView::userAccepted()
+{
+    mFrequencyScanner.reset( new RadioFrequencyScanner( mMainWindow->uiEngine(), this ) );
+    mFrequencyScanner->startScanning();
+}
+
+/*!
+ * Private slot
+ */
+void RadioMainView::setFrequencyFromWidget( uint frequency, int reason )
+{
+    LOG_FORMAT( "RadioMainView::setFrequencyFromWidget: %u, reason = %d", frequency, reason );
+    if ( !RadioUiUtilities::isScannerAlive() ) {
+        if ( reason == TuneReason::FrequencyStrip ) {
+            mCarousel->setFrequency( frequency, reason );
+            mMainWindow->uiEngine().tuneWithDelay( frequency, reason );
+        } else if ( reason == TuneReason::StationCarousel ) {
+            mFrequencyStrip->setFrequency( frequency, reason );
+            mMainWindow->uiEngine().tuneFrequency( frequency, reason );
+        }
+    }
+}
+
+/*!
+ * Private slot
+ */
+void RadioMainView::setFrequencyFromEngine( uint frequency, int reason )
+{
+    if ( !RadioUiUtilities::isScannerAlive() ) {
+        mCarousel->clearInfoText();
+        if ( reason != TuneReason::FrequencyStrip &&
+             reason != TuneReason::StationCarousel &&
+             reason != TuneReason::Skip ) {
+            mCarousel->setFrequency( frequency, reason );
+            mFrequencyStrip->setFrequency( frequency, reason );
+        }
+    }
+}
+
+/*!
+ * Private slot
+ */
+void RadioMainView::skip( int skipMode )
+{
+    if ( ( skipMode == StationSkip::PreviousFavorite || skipMode == StationSkip::NextFavorite ) &&
+        mMainWindow->uiEngine().stationModel().favoriteCount() == 0 ) {
+        mCarousel->setInfoText( CarouselInfoText::NoFavorites );
+    } else {
+        const uint currentFrequency = mFrequencyStrip->frequency();
+        const uint frequency = mMainWindow->uiEngine().skipStation( static_cast<StationSkip::Mode>( skipMode ),
+                                                                    currentFrequency);
+        mCarousel->setFrequency( frequency, TuneReason::Skip );
+        mFrequencyStrip->setFrequency( frequency, TuneReason::Skip );
+    }
+}
+
+/*!
+ * Private slot
+ */
+void RadioMainView::toggleScanning()
+{
+    if ( mFrequencyScanner ) {
+        mFrequencyScanner->cancelScanning();
+    } else {
+        const int rowCount =  mMainWindow->uiEngine().stationModel().rowCount();
+        if ( rowCount > 0 ) {
+            askQuestion( hbTrId( "txt_rad_info_all_stations_in_stations_list_will_be" ) );
+        } else {
+            userAccepted();
+        }
+    }
+}
+
+/*!
+ * Private slot
+ */
+void RadioMainView::seekingStarted()
+{
+    if ( !RadioUiUtilities::isScannerAlive() ) {
+        mCarousel->setInfoText( CarouselInfoText::Seeking );
+    }
+}
+
+/*!
+ * Private slot
+ */
+void RadioMainView::updateAudioRoute( bool loudspeaker )
+{
+    HbPushButton* loudspeakerButton = mUiLoader->findWidget<HbPushButton>( DOCML::MV_NAME_SPEAKER_BUTTON );
+    if ( loudspeaker ) {
+        loudspeakerButton->setIcon( HbIcon( "qtg_mono_speaker_off.svg" ) );
+        loudspeakerButton->setText( hbTrId( "txt_rad_button_deactivate_loudspeaker" ) );
+    } else {
+        loudspeakerButton->setIcon( HbIcon( "qtg_mono_speaker.svg" ) );
+        loudspeakerButton->setText( hbTrId( "txt_rad_button_activate_loudspeaker" ) );
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/src/radiostationcarousel.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,769 @@
+/*
+* 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:
+*
+*/
+
+// System includes
+#include <QGraphicsLinearLayout>
+#include <HbAnchorLayout>
+#include <QPixmap>
+#include <QGraphicsSceneMouseEvent>
+#include <HbEffect>
+#include <QTimer>
+#include <QTimeLine>
+#include <HbPanGesture>
+
+// User includes
+#include "radiostationcarousel.h"
+#include "radiouiloader.h"
+#include "radiostationitem.h"
+#include "radiostation.h"
+#include "radiouiengine.h"
+#include "radiostationmodel.h"
+#include "radiofadinglabel.h"
+#include "radiologger.h"
+#include "radiocarouselmodel.h"
+#include "radiouiutilities.h"
+#include "radio_global.h"
+
+#ifdef USE_LAYOUT_FROM_E_DRIVE
+    const QString KFavoriteIconPath = "e:/radiotest/images/favoriteiconactive.png";
+    const QString KNonFavoriteIconPath = "e:/radiotest/images/favoriteiconinactive.png";
+#else
+    const QString KFavoriteIconPath = ":/images/favoriteiconactive.png";
+    const QString KNonFavoriteIconPath = ":/images/favoriteiconinactive.png";
+#endif
+
+const int KRadioTextPlusCheckTimeout = 700; // 700 ms
+const int KFreqScrollDivider = 100000;
+const int INFOTEXT_NOFAVORITES_TIMEOUT = 15000;
+
+// ===============================================================
+//  Scanning helper
+// ===============================================================
+
+/*!
+ *
+ */
+ScanningHelper::ScanningHelper( RadioStationCarousel& carousel ) :
+    mCarousel( carousel ),
+    mCurrentFrequency( 0 ),
+    mPreviousFrequency( 0 ),
+    mStationItem( 0 ),
+    mNumberScrollingTimeLine( new QTimeLine( 1000, this ) )
+{
+    mNumberScrollingTimeLine->setCurveShape( QTimeLine::EaseInCurve );
+    connectAndTest( mNumberScrollingTimeLine,  SIGNAL(finished()),
+                    &mCarousel,                SIGNAL(scanAnimationFinished()) );
+    connectAndTest( mNumberScrollingTimeLine,  SIGNAL(frameChanged(int)),
+                    this,                      SLOT(numberScrollUpdate(int)) );
+}
+
+/*!
+ *
+ */
+void ScanningHelper::start()
+{
+    QTimer::singleShot( 0, this, SLOT(startSlide()) );
+}
+
+/*!
+ * Private slot
+ */
+void ScanningHelper::startSlide()
+{
+    mCarousel.scrollToIndex( mModelIndex, RadioStationCarousel::NoSignal );
+    startNumberScroll();
+}
+
+/*!
+ * Private slot
+ */
+void ScanningHelper::startNumberScroll()
+{
+    //TODO: Take italy case into account
+    if ( mPreviousFrequency ) {
+        mNumberScrollingTimeLine->setFrameRange( mPreviousFrequency / KFreqScrollDivider, mCurrentFrequency / KFreqScrollDivider );
+        mNumberScrollingTimeLine->start();
+    } else {
+        emit mCarousel.scanAnimationFinished();
+    }
+}
+
+/*!
+ * Private slot
+ */
+void ScanningHelper::numberScrollUpdate( int value )
+{
+    if ( mStationItem ) {
+        mStationItem->setFrequency( value * KFreqScrollDivider );
+    }
+}
+
+// ===============================================================
+//  Carousel
+// ===============================================================
+
+/*!
+ *
+ */
+RadioStationCarousel::RadioStationCarousel( RadioUiEngine* uiEngine ) :
+    HbGridView( 0 ),
+    mUiEngine( uiEngine ),
+    mAntennaAttached( false ),
+    mAutoScrollTime( 300 ),
+    mGenericTimer( new QTimer( this ) ),
+    mTimerMode( NoTimer ),
+    mScanningHelper( 0 ),
+    mInfoText( 0 ),
+    mCurrentItem( 0 ),
+    mPanStartPos( 0 )
+#ifdef USE_DEBUGGING_CONTROLS
+    ,mRdsLabel( new RadioFadingLabel( this ) )
+#endif // USE_DEBUGGING_CONTROLS
+{
+    RadioUiUtilities::setCarousel( this );
+    setClampingStyle( HbScrollArea::StrictClamping );
+    setScrollingStyle( HbScrollArea::Pan );
+}
+
+/*!
+ * Property
+ *
+ */
+void RadioStationCarousel::setFavoriteIcon( const HbIcon& favoriteIcon )
+{
+    mFavoriteIcon = favoriteIcon;
+}
+
+/*!
+ * Property
+ *
+ */
+HbIcon RadioStationCarousel::favoriteIcon() const
+{
+    return mFavoriteIcon;
+}
+
+/*!
+ * Property
+ *
+ */
+void RadioStationCarousel::setNonFavoriteIcon( const HbIcon& nonFavoriteIcon )
+{
+    mNonFavoriteIcon = nonFavoriteIcon;
+}
+
+/*!
+ * Property
+ *
+ */
+HbIcon RadioStationCarousel::nonFavoriteIcon() const
+{
+    return mNonFavoriteIcon;
+}
+
+/*!
+ *
+ */
+void RadioStationCarousel::setAutoScrollTime( const int time )
+{
+    mAutoScrollTime = time;
+}
+
+/*!
+ *
+ */
+int RadioStationCarousel::autoScrollTime() const
+{
+    return mAutoScrollTime;
+}
+
+/*!
+ *
+ */
+void RadioStationCarousel::init( RadioUiLoader& uiLoader, RadioUiEngine* uiEngine )
+{
+    mUiEngine = uiEngine;
+    mAntennaAttached = mUiEngine->isAntennaAttached();
+
+    mInfoText = uiLoader.findWidget<HbLabel>( DOCML::MV_NAME_INFO_TEXT );
+    mInfoText->setTextWrapping( Hb::TextWordWrap );
+
+    setRowCount( 1 );
+    setColumnCount( 1 );
+    setScrollDirections( Qt::Horizontal );
+    setFrictionEnabled( true );
+    setLongPressEnabled( false );
+    setItemRecycling( false );
+    setUniformItemSizes( true );
+    setItemPrototype( new RadioStationItem( *this ) );
+    setSelectionMode( NoSelection );
+
+//    grabGesture( Qt::PanGesture );
+
+    RadioCarouselModel* carouselModel = mUiEngine->carouselModel();
+    setCarouselModel( carouselModel );
+
+    mCurrentItem = static_cast<RadioStationItem*>( itemByIndex( carouselModel->index( 0, 0 ) ) );
+
+    RadioStationModel* stationModel = &mUiEngine->stationModel();
+    connectAndTest( stationModel,   SIGNAL(favoriteChanged(RadioStation)),
+                    this,           SLOT(update(RadioStation)) );
+    connectAndTest( stationModel,   SIGNAL(stationDataChanged(RadioStation)),
+                    this,           SLOT(update(RadioStation)));
+    connectAndTest( stationModel,   SIGNAL(radioTextReceived(RadioStation)),
+                    this,           SLOT(updateRadioText(RadioStation)));
+    connectAndTest( stationModel,   SIGNAL(dynamicPsChanged(RadioStation)),
+                    this,           SLOT(update(RadioStation)));
+
+    updateClampingStyle();
+
+    connectAndTest( this,           SIGNAL(longPressed(HbAbstractViewItem*,QPointF)),
+                    this,           SLOT(openContextMenu(HbAbstractViewItem*,QPointF)) );
+    setLongPressEnabled( true );
+
+    mGenericTimer->setSingleShot( true );
+    connectAndTest( mGenericTimer,  SIGNAL(timeout()),
+                    this,           SLOT(timerFired()));
+
+    initToLastTunedFrequency();
+
+#ifdef USE_DEBUGGING_CONTROLS
+    mRdsLabel->setPos( QPoint( 300, 10 ) );
+    mRdsLabel->setText( "RDS" );
+    mRdsLabel->setElideMode( Qt::ElideNone );
+    HbFontSpec spec = mRdsLabel->fontSpec();
+    spec.setTextPaneHeight( 10 );
+    spec.setRole( HbFontSpec::Secondary );
+    mRdsLabel->setFontSpec( spec );
+    mRdsLabel->setTextColor( Qt::gray );
+    if ( mUiEngine ) {
+        connectAndTest( mUiEngine,      SIGNAL(rdsAvailabilityChanged(bool)),
+                        this,           SLOT(setRdsAvailable(bool)) );
+    }
+#endif // USE_DEBUGGING_CONTROLS
+}
+
+/*!
+ *
+ */
+void RadioStationCarousel::setCarouselModel( RadioCarouselModel* carouselModel )
+{
+    if ( carouselModel ) {
+        connectAndTest( carouselModel,  SIGNAL(rowsInserted(QModelIndex,int,int)),
+                        this,           SLOT(insertFrequency(QModelIndex,int,int)) );
+        connectAndTest( carouselModel,  SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
+                        this,           SLOT(prepareToRemoveFrequency(QModelIndex,int,int)) );
+        connectAndTest( carouselModel,  SIGNAL(rowsRemoved(QModelIndex,int,int)),
+                        this,           SLOT(removeFrequency(QModelIndex,int,int)) );
+    } else {
+        QAbstractItemModel* currentModel = model();
+        disconnect( currentModel,   SIGNAL(rowsInserted(QModelIndex,int,int)),
+                    this,           SLOT(insertFrequency(QModelIndex,int,int)) );
+        disconnect( currentModel,   SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
+                    this,           SLOT(prepareToRemoveFrequency(QModelIndex,int,int)) );
+        disconnect( currentModel,   SIGNAL(rowsRemoved(QModelIndex,int,int)),
+                    this,           SLOT(removeFrequency(QModelIndex,int,int)) );
+    }
+    setModel( carouselModel );
+    updateFrequencies();
+    initCurrentStationItem();
+}
+
+/*!
+ *
+ */
+void RadioStationCarousel::setFrequency( uint frequency, int reason )
+{
+    RadioStationItem* item = currentStationItem();
+//    if ( item && item->mFrequency == frequency ) {
+//        return;
+//    }
+
+    if ( mModelIndexes.contains( frequency ) ) {
+        QModelIndex index = mModelIndexes.value( frequency );
+
+        if ( reason == TuneReason::FrequencyStrip || reason == TuneReason::StationsList ) {
+            scrollToIndex( index, RadioStationCarousel::NoAnim | RadioStationCarousel::NoSignal );
+        } else if ( reason == TuneReason::Skip || reason == TuneReason::StationScan ) {
+            scrollToIndex( index, RadioStationCarousel::NoSignal );
+        } else {
+            scrollToIndex( index );
+        }
+    } else {
+        if ( item ) {
+            item->setFrequency( frequency );
+        }
+    }
+}
+
+/*!
+ *
+ */
+RadioUiEngine* RadioStationCarousel::uiEngine()
+{
+    return mUiEngine;
+}
+
+/*!
+ *
+ */
+bool RadioStationCarousel::isAntennaAttached() const
+{
+    return mAntennaAttached;
+}
+
+/*!
+ *
+ */
+void RadioStationCarousel::setScanningMode( bool scanning )
+{
+    initCurrentStationItem();
+
+    if ( scanning ) {
+
+        setInfoText( CarouselInfoText::Scanning );
+        if ( !mScanningHelper ) {
+            mScanningHelper = new ScanningHelper( *this );
+        }
+    } else {
+        delete mScanningHelper;
+        mScanningHelper = 0;
+        clearInfoText();
+    }
+    setEnabled( !scanning );
+}
+
+/*!
+ *
+ */
+bool RadioStationCarousel::isInScanningMode() const
+{
+    return RadioUiUtilities::isScannerAlive();
+}
+
+/*!
+ *
+ */
+void RadioStationCarousel::cleanRdsData()
+{
+    RadioStationItem* item = currentStationItem();
+    if ( item ) {
+        item->cleanRdsData();
+    }
+}
+
+/*!
+ *
+ */
+void RadioStationCarousel::updateCurrentItem()
+{
+    RadioStationItem* item = currentStationItem();
+    if ( item ) {
+        item->update();
+    }
+}
+
+/*!
+ *
+ */
+void RadioStationCarousel::animateNewStation( const RadioStation& station )
+{
+    if ( mScanningHelper ) {
+        RadioCarouselModel* model = carouselModel();
+        const QModelIndex index = model->modelIndexFromFrequency( station.frequency() );
+        mScanningHelper->mModelIndex = index;
+        mScanningHelper->mCurrentFrequency = station.frequency();
+        mScanningHelper->mStationItem = static_cast<RadioStationItem*>( itemByIndex( index ) );
+
+        uint prevFrequency = 0;
+        if ( model->rowCount() > 1 ) {
+            const int prevIndex = index.row() - 1;
+            RadioStation prevStation = model->data( model->index( prevIndex, 0 ), RadioStationModel::RadioStationRole ).value<RadioStation>();
+            prevFrequency = prevStation.frequency();
+        } else if ( mUiEngine ) {
+            prevFrequency = mUiEngine->minFrequency();
+        }
+
+        mScanningHelper->mPreviousFrequency = prevFrequency;
+        if ( mScanningHelper->mStationItem ) {
+            mScanningHelper->mStationItem->setFrequency( prevFrequency );
+            mScanningHelper->mStationItem->cleanRdsData();
+        }
+
+        mScanningHelper->start();
+    }
+}
+
+/*!
+ *
+ */
+void RadioStationCarousel::setItemVisible( bool visible )
+{
+    RadioStationItem* item = currentStationItem();
+    if ( item ) {
+        item->setVisible( visible );
+    }
+}
+
+/*!
+ *
+ */
+void RadioStationCarousel::setInfoText( CarouselInfoText::Type type )
+{
+    mInfoTextType = type;
+    if ( type == CarouselInfoText::NoFavorites ) {
+        mInfoText->setPlainText( hbTrId( "txt_rad_dialog_long_press_arrow_keys_to_search_str" ) );
+        mInfoText->setAlignment( Qt::AlignCenter );
+        setItemVisible( false );
+        mTimerMode = InfoText;
+        mGenericTimer->setInterval( INFOTEXT_NOFAVORITES_TIMEOUT );
+        mGenericTimer->start();
+    } else if ( type == CarouselInfoText::ConnectAntenna ) {
+        cleanRdsData();
+        mInfoText->setPlainText( hbTrId( "txt_rad_info_connect_wired_headset1" ) );
+        mInfoText->setAlignment( Qt::AlignBottom | Qt::AlignHCenter );
+    } else if ( type == CarouselInfoText::Seeking ) {
+        cleanRdsData();
+        mInfoText->setAlignment( Qt::AlignBottom | Qt::AlignHCenter );
+        mInfoText->setPlainText( hbTrId( "txt_rad_list_seeking" ) );
+    } else if ( type == CarouselInfoText::Scanning ) {
+        cleanRdsData();
+        mInfoText->setAlignment( Qt::AlignBottom | Qt::AlignHCenter );
+        mInfoText->setPlainText( hbTrId( "txt_rad_list_searching_all_available_stations_ple" ) );
+    }
+
+    mInfoText->setVisible( true );
+}
+
+/*!
+ *
+ */
+void RadioStationCarousel::clearInfoText()
+{
+    if ( mInfoTextType != CarouselInfoText::None ) {
+        mGenericTimer->stop();
+        mInfoTextType = CarouselInfoText::None;
+        mInfoText->setVisible( false );
+        mInfoText->clear();
+        setItemVisible( true );
+        updateCurrentItem();
+    }
+}
+
+/*!
+ * Private slot
+ */
+void RadioStationCarousel::update( const RadioStation& station )
+{
+    RadioStationItem* item = currentStationItem();
+    if ( item && item->frequency() == station.frequency() && !isInScanningMode() ) {
+        item->update( &station );
+    }
+}
+
+/*!
+ * Private slot
+ */
+void RadioStationCarousel::updateRadioText( const RadioStation& station )
+{
+    if ( isAntennaAttached() && !isInScanningMode() ) {
+        if ( station.radioText().isEmpty() ) {
+            RadioStationItem* item = currentStationItem();
+            if ( item ) {
+                item->mRadiotextLabel->setText( "" );
+            }
+        } else {
+            mRadioTextHolder = station.radioText();
+            mTimerMode = RtPlusCheck;
+            mGenericTimer->stop();
+            mGenericTimer->setInterval( KRadioTextPlusCheckTimeout );
+            mGenericTimer->start();
+        }
+    }
+}
+
+/*!
+ * Private slot
+ */
+void RadioStationCarousel::insertFrequency( const QModelIndex& parent, int first, int last )
+{
+    Q_UNUSED( parent );
+    QAbstractItemModel* freqModel = model();
+
+    for ( int i = first; freqModel && i <= last; ++i ) {
+        QModelIndex index = freqModel->index( i, 0 );
+        RadioStation station = freqModel->data( index, RadioStationModel::RadioStationRole ).value<RadioStation>();
+        mModelIndexes.insert( station.frequency(), index );
+        LOG_FORMAT( "Added frequency %u", station.frequency() );
+        if ( !isInScanningMode() ) {
+            scrollToIndex( index, RadioStationCarousel::NoAnim | RadioStationCarousel::NoSignal );
+        }
+    }
+
+    initCurrentStationItem();
+
+    updateClampingStyle();
+}
+
+/*!
+ * Private slot
+ */
+void RadioStationCarousel::prepareToRemoveFrequency( const QModelIndex& parent, int first, int last )
+{
+    Q_UNUSED( parent );
+    QAbstractItemModel* freqModel = model();
+    for ( int i = first; freqModel && i <= last; ++i ) {
+        QModelIndex index = freqModel->index( i, 0 );
+        RadioStation station = freqModel->data( index, RadioStationModel::RadioStationRole ).value<RadioStation>();
+        mModelIndexes.remove( station.frequency() );
+    }
+}
+
+/*!
+ * Private slot
+ */
+void RadioStationCarousel::removeFrequency( const QModelIndex& parent, int first, int last )
+{
+    Q_UNUSED( parent );
+    Q_UNUSED( first );
+    Q_UNUSED( last );
+
+    initCurrentStationItem();
+    updateClampingStyle();
+}
+
+/*!
+ * Private slot
+ */
+void RadioStationCarousel::updateFrequencies()
+{
+    mModelIndexes.clear();
+    QAbstractItemModel* itemModel = model();
+    if ( itemModel ) {
+        const int count = itemModel->rowCount();
+        for ( int i = 0; i < count; ++i ) {
+            QModelIndex index = itemModel->index( i, 0 );
+            uint frequency = itemModel->data( index, RadioStationModel::RadioStationRole ).value<RadioStation>().frequency();
+            mModelIndexes.insert( frequency, index );
+        }
+    }
+}
+
+/*!
+ * Private slot
+ */
+void RadioStationCarousel::timerFired()
+{
+    if ( mTimerMode == RtPlusCheck ) {
+        RadioStationItem* item = currentStationItem();
+        if ( item ) {
+            item->mRadiotextLabel->setText( mRadioTextHolder );
+        }
+        mRadioTextHolder = "";
+    } else if ( mTimerMode == InfoText ) {
+        clearInfoText();
+    }
+
+    mTimerMode = NoTimer;
+}
+
+/*!
+ * Private slot
+ */
+void RadioStationCarousel::openContextMenu( HbAbstractViewItem* item, const QPointF& coords )
+{
+    if ( item ) {
+        static_cast<RadioStationItem*>( item )->handleLongPress( coords );
+    }
+}
+
+#ifdef USE_DEBUGGING_CONTROLS
+/*!
+ * Public slot
+ */
+void RadioStationCarousel::setRdsAvailable( bool available )
+{
+    QColor color = Qt::green;
+    if ( !available && mUiEngine ) {
+        LOG_FORMAT( "No RDS signal: Station has sent RDS earlier: %d", mUiEngine.model().currentStation().hasRds() );
+        color = mUiEngine.model().currentStation().hasRds() ? Qt::yellow : Qt::gray;
+        mRdsLabel->setText( "RDS" );
+    } else {
+        mRdsLabel->setText( "-RDS-" );
+    }
+    mRdsLabel->setTextColor( color );
+}
+#endif // USE_DEBUGGING_CONTROLS
+
+/*!
+ * Public slot
+ */
+void RadioStationCarousel::updateAntennaStatus( bool connected )
+{
+    mAntennaAttached = connected;
+    mGenericTimer->stop();
+
+    if ( !connected ) {
+        setInfoText( CarouselInfoText::ConnectAntenna );
+    } else {
+        clearInfoText();
+    }
+}
+
+/*!
+ * \reimp
+ */
+void RadioStationCarousel::mousePressEvent( QGraphicsSceneMouseEvent* event )
+{
+    if ( mInfoTextType == CarouselInfoText::NoFavorites ) {
+        clearInfoText();
+    }
+
+    HbGridView::mousePressEvent( event );
+}
+
+/*!
+ * \reimp
+ */
+void RadioStationCarousel::gestureEvent( QGestureEvent* event )
+{
+    HbGridView::gestureEvent( event );
+
+    if ( HbPanGesture* gesture = qobject_cast<HbPanGesture*>( event->gesture( Qt::PanGesture ) ) ) {
+        if ( gesture->state() == Qt::GestureFinished ) {
+            updatePos( (int)gesture->offset().x() );
+        }
+    }
+}
+
+/*!
+ *
+ */
+void RadioStationCarousel::initToLastTunedFrequency()
+{
+    const uint currentFrequency = mUiEngine->currentFrequency();
+    const QModelIndex currentIndex = carouselModel()->modelIndexFromFrequency( currentFrequency );
+
+    if ( currentIndex.isValid() ) {//&& itemByIndex( currentIndex ) ) {
+        scrollToIndex( currentIndex, RadioStationCarousel::NoSignal | RadioStationCarousel::NoAnim );
+    } else {
+        RadioStationItem* item = static_cast<RadioStationItem*>( itemAt( 0, 0 ) );
+        if ( item ) {
+            item->setFrequency( currentFrequency );
+        }
+    }
+}
+
+/*!
+ *
+ */
+void RadioStationCarousel::updateClampingStyle()
+{
+    if ( model()->rowCount() > 1 ) {
+        setClampingStyle( HbScrollArea::StrictClamping );
+    } else {
+        setClampingStyle( HbScrollArea::BounceBackClamping );
+        update( mUiEngine->stationModel().currentStation() );
+    }
+}
+
+/*!
+ *
+ */
+void RadioStationCarousel::initCurrentStationItem()
+{
+    mCurrentItem = static_cast<RadioStationItem*>( visibleItems().first() );
+}
+
+/*!
+ *
+ */
+RadioStationItem* RadioStationCarousel::currentStationItem()
+{
+    return mCurrentItem;
+}
+
+/*!
+ *
+ */
+RadioCarouselModel* RadioStationCarousel::carouselModel() const
+{
+    return static_cast<RadioCarouselModel*>( model() );
+}
+
+/*!
+ *
+ */
+void RadioStationCarousel::scrollToIndex( const QModelIndex& index, RadioStationCarousel::ScrollMode mode )
+{
+    RadioStationItem* item = static_cast<RadioStationItem*>( itemByIndex( index ) );
+    if ( index.isValid() && item ) {
+        const int posX = index.row() * (int)size().width();
+        setCurrentIndex( index, QItemSelectionModel::ClearAndSelect );
+
+        if ( mode.testFlag( UpdateItem ) ) {
+            item->update();
+        }
+
+        int scrollTime = mAutoScrollTime;
+        if ( mode.testFlag( NoAnim ) ) {
+            scrollTime = 0;
+        }
+        scrollContentsTo( QPointF( posX, 0 ), scrollTime );
+        mCurrentItem = static_cast<RadioStationItem*>( item );
+        if ( !mode.testFlag( NoSignal ) ) {
+            uint frequency = model()->data( index, RadioStationModel::RadioStationRole ).value<RadioStation>().frequency();
+            emit frequencyChanged( frequency, TuneReason::StationCarousel );
+        }
+    }
+}
+
+/*!
+ *
+ */
+void RadioStationCarousel::updatePos( int offset )
+{
+//    QModelIndex index = currentIndex();
+//
+//    ScrollMode mode = 0;
+//    const qreal threshold = size().width() / 3;
+//    if ( abs( offset ) >= threshold ) {
+//        if ( offset > 0 ) {
+//            index = previousIndex( index );
+//        } else {
+//            index = nextIndex( index );
+//        }
+//    } else {
+//        mode |= RadioStationCarousel::NoSignal;
+//    }
+//
+//    scrollToIndex( index, mode );
+}
+
+/*!
+ *
+ */
+void RadioStationCarousel::skip( StationSkip::Mode mode )
+{
+    RadioStationItem* item = currentStationItem();
+    if ( item ) {
+        RadioCarouselModel* model = carouselModel();
+        const uint frequency = model->findClosest( item->frequency(), mode ).frequency();
+        const QModelIndex& index = model->modelIndexFromFrequency( frequency );
+        scrollToIndex( index, RadioStationCarousel::NoSignal );
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/src/radiostationitem.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,284 @@
+/*
+* 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:
+*
+*/
+
+// System includes
+#include <HbStyleLoader>
+#include <HbPushButton>
+#include <HbAnchorLayout>
+#include <HbMessageBox>
+
+// User includes
+#include "radiostationitem.h"
+#include "radiostationcarousel.h"
+#include "radiouiengine.h"
+#include "radiofadinglabel.h"
+#include "radiostationmodel.h"
+#include "radiologger.h"
+
+//static const char* FILE_PATH_WIDGETML   = ":/layout/radiostationitem.widgetml";
+//static const char* FILE_PATH_CSS        = ":/layout/radiostationitem.css";
+static const char* GENRE_LABEL            = "tv:genre_label";
+static const char* NAME_LABEL             = "tv:name_label";
+static const char* RADIOTEXT_LABEL        = "tv:radiotext_label";
+static const char* URL_LABEL              = "tv:url_label";
+//static const char* FAVORITE_BUTTON      = "favorite_button";
+
+const char* SEEKING_TEXT = "txt_rad_list_tuning";
+const char* CONNECT_HEADSET_TEXT = "txt_rad_list_connect_wireless_antenna_headset_with";
+
+/*!
+ *
+ */
+RadioStationItem::RadioStationItem( RadioStationCarousel& carousel ) :
+    HbAbstractViewItem( &carousel ),
+    mCarousel( carousel ),
+    mLayout( 0 ),
+    mNameLabel( 0 ),
+    mIconButton( 0 ),
+    mGenreLabel( 0 ),
+    mRadiotextLabel( 0 ),
+    mUrlLabel( 0 )
+{
+    setFlag( QGraphicsItem::ItemIsFocusable, true );
+}
+
+/*!
+ * From HbAbstractViewItem
+ *
+ */
+HbAbstractViewItem* RadioStationItem::createItem()
+{
+    RadioStationItem* item = new RadioStationItem( *this ); // Calls copy constructor
+//    item->setParent( &mCarousel );
+//    item->setParentItem( &mCarousel );
+//    item->setItemView( itemView() );
+//    item->updateChildItems();
+    return item;
+}
+
+/*!
+ * From HbAbstractViewItem
+ */
+void RadioStationItem::updateChildItems()
+{
+    if ( !mLayout )
+    {
+        mIconButton = new HbPushButton( this );
+        QPixmap background( QSize( 50, 50 ) );
+        background.fill( Qt::transparent );
+        mIconButton->setBackground( HbIcon( background ) );
+        mIconButton->setIcon( mCarousel.nonFavoriteIcon() );
+        mIconButton->setMaximumSize( 50, 50 );
+        connectAndTest( mIconButton, SIGNAL(clicked()), this, SLOT(toggleFavorite()));
+
+        mNameLabel = new RadioFadingLabel( this );
+        mNameLabel->setAlignment( Qt::AlignCenter );
+        mNameLabel->setObjectName( NAME_LABEL );
+        HbFontSpec spec = mNameLabel->fontSpec();
+        spec.setRole( HbFontSpec::Primary );
+        mNameLabel->setFontSpec( spec );
+
+        spec.setRole( HbFontSpec::Secondary );
+
+        mGenreLabel = new RadioFadingLabel( this );
+        mGenreLabel->setAlignment( Qt::AlignCenter );
+        mGenreLabel->setObjectName( GENRE_LABEL );
+        mGenreLabel->setTextColor( Qt::white );
+
+        mRadiotextLabel = new RadioFadingLabel( this );
+        mRadiotextLabel->setAlignment( Qt::AlignCenter );
+        mRadiotextLabel->setObjectName( RADIOTEXT_LABEL );
+        mRadiotextLabel->setTextWrapping( Hb::TextWordWrap );
+//        mRadiotextLabel->setFadingEnabled( true );    TODO
+//        mRadiotextLabel->setFontSpec( spec );
+        mRadiotextLabel->setTextColor( Qt::white );
+
+        mUrlLabel = new RadioFadingLabel( this );
+        mUrlLabel->setAlignment( Qt::AlignCenter );
+        mUrlLabel->setObjectName( URL_LABEL );
+        mUrlLabel->setTextColor( Qt::white );
+
+        mLayout = new HbAnchorLayout();
+
+        mLayout->setAnchor( mLayout, Hb::TopEdge, mIconButton, Hb::TopEdge, 20.0 );
+        mLayout->setAnchor( mLayout, Hb::LeftEdge, mIconButton, Hb::LeftEdge, 20.0 );
+
+        mLayout->setAnchor( mIconButton, Hb::CenterVEdge, mGenreLabel, Hb::CenterVEdge, 0.0 );
+        mLayout->setAnchor( mIconButton, Hb::RightEdge, mGenreLabel, Hb::LeftEdge, 20.0 );
+        mLayout->setAnchor( mLayout, Hb::RightEdge, mGenreLabel, Hb::RightEdge, -70.0 );
+
+        mLayout->setAnchor( mGenreLabel, Hb::BottomEdge, mNameLabel, Hb::TopEdge, 0.0 );
+        mLayout->setAnchor( mLayout, Hb::LeftEdge, mNameLabel, Hb::LeftEdge, 10.0 );
+        mLayout->setAnchor( mLayout, Hb::RightEdge, mNameLabel, Hb::RightEdge, -10.0 );
+
+        mLayout->setAnchor( mNameLabel, Hb::BottomEdge, mRadiotextLabel, Hb::TopEdge, 10.0 );
+        mLayout->setAnchor( mLayout, Hb::LeftEdge, mRadiotextLabel, Hb::LeftEdge, 10.0 );
+        mLayout->setAnchor( mLayout, Hb::RightEdge, mRadiotextLabel, Hb::RightEdge, -10.0 );
+
+        mLayout->setAnchor( mRadiotextLabel, Hb::BottomEdge, mUrlLabel, Hb::TopEdge, 10.0 );
+        mLayout->setAnchor( mLayout, Hb::LeftEdge, mUrlLabel, Hb::LeftEdge, 10.0 );
+        mLayout->setAnchor( mLayout, Hb::RightEdge, mUrlLabel, Hb::RightEdge, -10.0 );
+        mLayout->setAnchor( mLayout, Hb::BottomEdge, mUrlLabel, Hb::BottomEdge, -10.0 );
+
+        setLayout( mLayout );
+    }
+
+    update();
+}
+
+/*!
+ * Private slot
+ *
+ */
+void RadioStationItem::toggleFavorite()
+{
+    RadioUiEngine* uiEngine = carousel()->uiEngine();
+    if ( uiEngine ) {
+        uiEngine->stationModel().setData( modelIndex(), mFrequency, RadioStationModel::ToggleFavoriteRole );
+    }
+}
+
+/*!
+ *
+ */
+uint RadioStationItem::frequency() const
+{
+    return mFrequency;
+}
+
+/*!
+ *
+ */
+void RadioStationItem::update( const RadioStation* station )
+{
+    QModelIndex index = modelIndex();
+    if ( !( station && station->isValid() ) && !index.isValid() ) {
+        return;
+    }
+
+    RadioUiEngine* uiEngine = carousel()->uiEngine();
+    if ( !mCarousel.isInScanningMode() && uiEngine ) {
+        RadioStation tempStation = ( station && station->isValid() ) ? *station
+                        : index.data( RadioStationModel::RadioStationRole ).value<RadioStation>();
+
+        mNameLabel->setTextWithoutFading( nameOrFrequency( tempStation ) );
+
+        mGenreLabel->setText( uiEngine->genreToString( tempStation.genre(), GenreTarget::Carousel ) );
+
+        if ( !tempStation.radioText().isEmpty() ) {
+            mRadiotextLabel->setText( tempStation.radioText() );
+        } else if ( !tempStation.dynamicPsText().isEmpty() ) {
+            mRadiotextLabel->setText( tempStation.dynamicPsText() );
+        } else {
+            mRadiotextLabel->setText( "" );
+        }
+
+        mUrlLabel->setText( tempStation.url() );
+
+        mFrequency = tempStation.frequency();
+
+        updateFavoriteIcon( tempStation.isFavorite() );
+    }
+}
+
+/*!
+ *
+ */
+void RadioStationItem::setFrequency( uint frequency )
+{
+    LOG_FORMAT( "RadioStationItem::setFrequency: %d", frequency );
+
+    mNameLabel->setTextWithoutFading( parseFrequency( frequency ) );
+    mGenreLabel->setTextWithoutFading( "" );
+    mRadiotextLabel->setTextWithoutFading( "" );
+    mUrlLabel->setTextWithoutFading( "" );
+    mFrequency = frequency;
+    updateFavoriteIcon( false );
+}
+
+/*!
+ *
+ */
+void RadioStationItem::cleanRdsData()
+{
+    mNameLabel->setTextWithoutFading( "" );
+    mGenreLabel->setTextWithoutFading( "" );
+    mRadiotextLabel->setTextWithoutFading( "" );
+    mUrlLabel->setTextWithoutFading( "" );
+}
+
+/*!
+ *
+ */
+void RadioStationItem::handleLongPress( const QPointF& /*coords*/ )
+{
+    QString text = QString( "Selected frequency: %1" ).arg( mFrequency );
+//    HbMessageBox::information( text );
+}
+
+/*!
+ *
+ */
+void RadioStationItem::updateFavoriteIcon( bool isFavorite )
+{
+    if ( !mCarousel.isInScanningMode() ) {
+        if ( isFavorite ) {
+            mIconButton->setIcon( mCarousel.favoriteIcon() );
+        } else {
+            mIconButton->setIcon( mCarousel.nonFavoriteIcon() );
+        }
+    } else {
+        mIconButton->setIcon( HbIcon( "" ) );
+    }
+}
+
+/*!
+ *
+ */
+RadioStationCarousel* RadioStationItem::carousel()
+{
+    return static_cast<RadioStationCarousel*>( itemView() );
+}
+
+/*!
+ *
+ */
+QString RadioStationItem::parseFrequency( const uint frequency )
+{
+    //TODO: Frequency localization temporarily disabled
+    QString loc = "%L1 Mhz";// "txt_rad_list_l1_mhz_big" );
+    return loc.arg( RadioStation::parseFrequency( frequency ) );
+}
+
+/*!
+ *
+ */
+QString RadioStationItem::nameOrFrequency( const RadioStation& station, uint frequency )
+{
+    if ( frequency == 0 ) {
+        frequency = station.frequency();
+    }
+
+    QString text = "";
+    if ( station.isValid() && !station.name().isEmpty() ) {
+        text = station.name();
+    } else {
+        text = parseFrequency( frequency );
+    }
+
+    return text;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/src/radiostationsview.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,377 @@
+/*
+* 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:
+*
+*/
+
+// System includes
+#include <HbListView>
+#include <HbAbstractViewItem>
+#include <HbPushButton>
+#include <HbEffect>
+#include <HbAction>
+#include <HbInputDialog>
+#include <HbMenu>
+
+// User includes
+#include "radiostationsview.h"
+#include "radiologger.h"
+#include "radiowindow.h"
+#include "radiouiengine.h"
+#include "radiobannerlabel.h"
+#include "radiofrequencyscanner.h"
+#include "radiouiloader.h"
+#include "radiostationmodel.h"
+#include "radiostation.h"
+#include "radiostationfiltermodel.h"
+
+/*!
+ *
+ */
+RadioStationsView::RadioStationsView() :
+    RadioViewBase( false ),
+    mModel( 0 ),
+    mFilterModel( 0 ),
+    mScanStationsAction( 0 ),
+    mClearListAction( 0 ),
+    mStationsList( 0 ),
+    mHeadingBanner( 0 ),
+    mFavoritesButton( 0 ),
+    mLocalStationsButton( 0 ),
+    mSelectedStation( new RadioStation ),
+    mCurrentQuestion( NoQuestion )
+{
+}
+
+/*!
+ *
+ */
+RadioStationsView::~RadioStationsView()
+{
+}
+
+/*!
+ *
+ */
+void RadioStationsView::setNowPlayingIcon( const HbIcon& nowPlayingIcon )
+{
+    mNowPlayingIcon = nowPlayingIcon;
+}
+
+/*!
+ *
+ */
+HbIcon RadioStationsView::nowPlayingIcon() const
+{
+    return mNowPlayingIcon;
+}
+
+/*!
+ *
+ */
+void RadioStationsView::setFavoriteIcon( const HbIcon& favoriteIcon )
+{
+    mFavoriteIcon = favoriteIcon;
+}
+
+/*!
+ *
+ */
+HbIcon RadioStationsView::favoriteIcon() const
+{
+    return mFavoriteIcon;
+}
+
+/*!
+ * Private slot
+ *
+ */
+void RadioStationsView::listItemClicked( const QModelIndex& index )
+{
+    LOG_TIMESTAMP( "Channel change started" );
+    QModelIndex sourceIndex = mFilterModel->mapToSource( index );
+    *mSelectedStation = mModel->stationAt( sourceIndex.row() );
+    mMainWindow->uiEngine().tuneFrequency( mSelectedStation->frequency(), TuneReason::StationsList );
+}
+
+/*!
+ * Private slot
+ *
+ */
+void RadioStationsView::listItemLongPressed( HbAbstractViewItem* item, const QPointF& coords )
+{
+    Q_UNUSED( item );
+
+    HbMenu* menu = mUiLoader->findObject<HbMenu>( DOCML::NAME_CONTEXT_MENU );
+
+    *mSelectedStation = mFilterModel->data( item->modelIndex(), RadioStationModel::RadioStationRole ).value<RadioStation>();
+
+    HbAction* favoriteAction = mUiLoader->findObject<HbAction>( DOCML::NAME_CONTEXT_FAVORITE );
+    if ( mSelectedStation->isFavorite() ) {
+        favoriteAction->setText( hbTrId( "txt_rad_menu_remove_favourite" ) );
+    } else {
+        favoriteAction->setText( hbTrId( "txt_rad_menu_add_to_favourites" ) );
+    }
+
+    menu->setPreferredPos( QPointF( size().width() / 2 - menu->size().width() / 2, coords.y() - menu->size().height() / 2 ) );
+    menu->show();
+}
+
+/*!
+ * Private slot
+ *
+ */
+void RadioStationsView::updateAntennaStatus( bool connected )
+{
+    Q_UNUSED( connected );
+    updateControlVisibilities();
+}
+
+/*!
+ * Private slot
+ *
+ */
+void RadioStationsView::updateCurrentStation()
+{
+    mFilterModel->invalidate();
+}
+
+/*!
+ * Private slot
+ *
+ */
+void RadioStationsView::deckButtonPressed()
+{
+    const bool showFavorites = mFavoritesButton->isChecked();
+    if ( showFavorites ) {
+        loadSection( DOCML::FILE_STATIONSVIEW, DOCML::SV_SECTION_SHOW_FAVORITES );
+    } else {
+        loadSection( DOCML::FILE_STATIONSVIEW, DOCML::SV_SECTION_SHOW_ALL_STATIONS );
+    }
+
+    mFilterModel->setTypeFilter( showFavorites ? RadioStation::Favorite
+                                               : RadioStation::LocalStation );
+
+    updateControlVisibilities();
+}
+
+/*!
+ * Private slot
+ *
+ */
+void RadioStationsView::startScanning()
+{
+    const int rowCount =  mMainWindow->uiEngine().stationModel().rowCount();
+    mCurrentQuestion = StartScanning;
+    if ( rowCount > 0 ) {
+        askQuestion( hbTrId( "txt_rad_info_all_stations_in_stations_list_will_be" ) );
+    } else {
+        userAccepted();
+    }
+}
+
+/*!
+ * Private slot
+ *
+ */
+void RadioStationsView::finishScanning()
+{
+    updateControlVisibilities();
+    mFrequencyScanner.take();
+}
+
+/*!
+ * Private slot
+ *
+ */
+void RadioStationsView::updateControlVisibilities()
+{
+    LOG_SLOT_CALLER;
+    bool listEmpty = mModel->rowCount() == 0;
+    const bool localStationsMode = !mFavoritesButton->isChecked();
+
+    if ( !localStationsMode ) {
+        listEmpty = mModel->favoriteCount() == 0;
+    }
+
+    mClearListAction->setVisible( !listEmpty );
+
+    const bool scanAvailable = mMainWindow->uiEngine().isAntennaAttached() && localStationsMode;
+    mScanStationsAction->setVisible( scanAvailable );
+    HbPushButton* scanButton = mUiLoader->findWidget<HbPushButton>( DOCML::SV_NAME_SCAN_BUTTON );
+    scanButton->setEnabled( scanAvailable );
+
+    loadSection( DOCML::FILE_STATIONSVIEW, listEmpty ? DOCML::SV_SECTION_SHOW_SCAN_TEXT : DOCML::SV_SECTION_HIDE_SCAN_TEXT );
+}
+
+/*!
+ * Private slot
+ *
+ */
+void RadioStationsView::clearList()
+{
+    const bool favoriteMode = mFavoritesButton->isChecked();
+    mCurrentQuestion = ClearList;
+    askQuestion( hbTrId( favoriteMode ? "txt_rad_info_clear_favourite_stations_list"
+                                      : "txt_rad_info_clear_all_stations_list" ) );
+}
+
+/*!
+ * Private slot
+ *
+ */
+void RadioStationsView::rename()
+{
+    HbInputDialog* nameQuery = new HbInputDialog();
+    nameQuery->setAttribute( Qt::WA_DeleteOnClose, true );
+    nameQuery->setDismissPolicy( HbDialog::NoDismiss );
+    nameQuery->setPromptText( hbTrId( "txt_rad_dialog_new_name" ) );
+    nameQuery->setInputMode( HbInputDialog::TextInput );
+    nameQuery->setValue( mSelectedStation->name() );
+    nameQuery->setObjectName( DOCML::NAME_INPUT_QUERY );
+    nameQuery->open( this, SLOT(renameDone(HbAction* )) );
+}
+
+/*!
+ * Private slot
+ *
+ */
+void RadioStationsView::toggleFavorite()
+{
+    mModel->setFavoriteByPreset( mSelectedStation->presetIndex(), !mSelectedStation->isFavorite() );
+}
+
+/*!
+ * Private slot
+ *
+ */
+void RadioStationsView::deleteStation()
+{
+    mCurrentQuestion = DeleteStation;
+    askQuestion( hbTrId( "txt_rad_menu_delete_station" ) );
+}
+
+/*!
+ * Private slot
+ *
+ */
+void RadioStationsView::renameDone( HbAction* action )
+{
+    HbInputDialog* dlg = static_cast<HbInputDialog*>( sender() );
+
+    if( action == dlg->primaryAction() ) {
+        mModel->renameStation( mSelectedStation->presetIndex(), dlg->value().toString() );
+    }
+}
+
+/*!
+ * From RadioViewBase
+ *
+ */
+void RadioStationsView::init()
+{
+    LOG_METHOD;
+    mInitialized = true;
+    mModel = &mMainWindow->uiEngine().stationModel();
+
+    RadioUiEngine* engine = &mMainWindow->uiEngine();
+
+    mFilterModel = engine->createNewFilterModel( this );
+    mFilterModel->setTypeFilter( RadioStation::LocalStation );
+
+    loadSection( DOCML::FILE_STATIONSVIEW, DOCML::SV_SECTION_SHOW_ALL_STATIONS );
+
+    if ( !mFavoriteIcon.isNull() && !mNowPlayingIcon.isNull() ) {
+        mModel->setIcons( mFavoriteIcon.qicon(), mNowPlayingIcon.qicon() );
+    }
+    mModel->setDetail( RadioStationModel::ShowIcons | RadioStationModel::ShowGenre );
+
+    mStationsList           = mUiLoader->findObject<HbListView>( DOCML::SV_NAME_STATIONS_LIST );
+    mHeadingBanner          = mUiLoader->findWidget<RadioBannerLabel>( DOCML::SV_NAME_HEADING_BANNER );
+    mFavoritesButton        = mUiLoader->findObject<HbAction>( DOCML::SV_NAME_FAVORITES_BUTTON );
+    mLocalStationsButton    = mUiLoader->findObject<HbAction>( DOCML::SV_NAME_LOCALS_BUTTON );
+
+    connectAndTest( engine,                 SIGNAL(antennaStatusChanged(bool)),
+                    this,                   SLOT(updateAntennaStatus(bool)) );
+    connectAndTest( mModel,                 SIGNAL(rowsInserted(QModelIndex,int,int)),
+                    this,                   SLOT(updateControlVisibilities() ) );
+    connectAndTest( mModel,                 SIGNAL(rowsRemoved(QModelIndex,int,int)),
+                    this,                   SLOT(updateControlVisibilities()) );
+    connectAndTest( mModel,                 SIGNAL(modelReset() ),
+                    this,                   SLOT(updateControlVisibilities() ) );
+    connectAndTest( mFavoritesButton,       SIGNAL(triggered() ),
+                    this,                   SLOT(deckButtonPressed() ) );
+    connectAndTest( mLocalStationsButton,   SIGNAL(triggered() ),
+                    this,                   SLOT(deckButtonPressed() ) );
+
+    connectAndTest( engine, SIGNAL(tunedToFrequency(uint,int)), this, SLOT(updateCurrentStation()) );
+
+    // "Scan local stations" menu item
+    mScanStationsAction = mUiLoader->findObject<HbAction>( DOCML::SV_NAME_SCAN_ACTION );
+    
+    // "Remove all presets" menu item
+    mClearListAction = mUiLoader->findObject<HbAction>( DOCML::SV_NAME_CLEAR_LIST_ACTION );
+    connectAndTest( mClearListAction,   SIGNAL(triggered() ),
+                    this,               SLOT(clearList() ) );
+
+    connectCommonMenuItem( MenuItem::UseLoudspeaker );
+
+    initListView();
+    
+    initBackAction();
+
+    updateControlVisibilities();
+}
+
+/*!
+ * \reimp
+ */
+void RadioStationsView::userAccepted()
+{
+    if ( mCurrentQuestion == StartScanning ) {
+        mFrequencyScanner.reset( new RadioFrequencyScanner( mMainWindow->uiEngine(), this ) );
+
+        connectAndTest( mFrequencyScanner.data(),   SIGNAL(frequencyScannerFinished()),
+                        this,                       SLOT(finishScanning()) );
+
+        mFrequencyScanner->startScanning();
+    } else if ( mCurrentQuestion == ClearList ){
+        const bool favoriteMode = mFavoritesButton->isChecked();
+        mModel->removeAll( favoriteMode ? RadioStationModel::RemoveFavorites : RadioStationModel::RemoveAll );
+        updateControlVisibilities();
+    } else if ( mCurrentQuestion == DeleteStation ) {
+        mModel->removeStation( mModel->currentStation() );
+    }
+
+    mCurrentQuestion = NoQuestion;
+}
+
+/*!
+ * \reimp
+ */
+void RadioStationsView::showEvent( QShowEvent* event )
+{
+    RadioViewBase::showEvent( event );
+}
+
+/*!
+ *
+ */
+void RadioStationsView::initListView()
+{
+    mStationsList->setScrollingStyle( HbListView::PanOrFlick );
+    mStationsList->setModel( mFilterModel );
+    mStationsList->setSelectionMode( HbListView::NoSelection );
+    mStationsList->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/src/radiostripbase.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,510 @@
+/*
+* 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:
+*
+*/
+
+// System includes
+#include <QGraphicsSceneEvent>
+
+// User includes
+#include "radiostripbase.h"
+#include "radiologger.h"
+
+// Constants
+
+/*!
+ *
+ */
+RadioStripBase::RadioStripBase( QGraphicsItem* parent ) :
+    HbScrollArea( parent ),
+    mAutoScrollTime( 0 ),
+    mStripContainer( new HbWidget( this ) ),
+    mModel( 0 ),
+    mIsCyclic( true ),
+    mAutoCenter( false ),
+    mSpacing( 0 ),
+    mItemPoolParent( new QGraphicsWidget( NULL ) ),
+    mCurrentIndex( 0 ),
+    mPressedIndex( 0 ),
+    mStripLength( 0 ),
+    mContentsLength( 0 )
+{
+    setClampingStyle( HbScrollArea::NoClamping );
+    setScrollDirections( Qt::Horizontal );
+    setFlag( QGraphicsItem::ItemClipsChildrenToShape, true );
+    setContentWidget( mStripContainer );
+    setFrictionEnabled( true );
+    setLongPressEnabled( false );
+    setHorizontalScrollBarPolicy( HbScrollArea::ScrollBarAlwaysOff );
+    setVerticalScrollBarPolicy( HbScrollArea::ScrollBarAlwaysOff );
+
+    // mItemParent is used to hold the unused QGraphicsItem's in the pool.  It's visibility is set to false
+    // so the visibility of the items doesn't need to be modified.
+    mItemPoolParent->setVisible( false );
+
+    connectAndTest( this,   SIGNAL(scrollPositionChanged(QPointF)),
+                    this,   SLOT(scrollPositionChanged(QPointF)));
+}
+
+/*!
+ *
+ */
+RadioStripBase::~RadioStripBase()
+{
+}
+
+/*!
+ *
+ */
+void RadioStripBase::setAutoScrollTime( const int time )
+{
+    mAutoScrollTime = time;
+}
+
+/*!
+ *
+ */
+int RadioStripBase::autoScrollTime() const
+{
+    return mAutoScrollTime;
+}
+
+/*!
+ *
+ */
+void RadioStripBase::setModel( QAbstractItemModel* model )
+{
+    if ( mModel != model )
+    {
+    //    if ( mModel )
+    //    {
+    //        disconnectDataModel();
+    //    }
+
+        mModel = model;
+
+        if ( mModel )
+        {
+    //        connectDataModel();
+
+            mCurrentIndex = 0;
+            populateAndLayout();
+        }
+    }
+}
+
+/*!
+ *
+ */
+QAbstractItemModel* RadioStripBase::model() const
+{
+    return mModel;
+}
+
+/*!
+ *
+ */
+void RadioStripBase::setCyclic( bool isCyclic )
+{
+    mIsCyclic = isCyclic;
+}
+
+/*!
+ *
+ */
+void RadioStripBase::setSpacing( qreal spacing )
+{
+    if ( mSpacing != spacing )
+    {
+        mSpacing = spacing;
+
+        prepareGeometryChange();
+
+        populateAndLayout();
+
+        update();
+        updateGeometry();
+    }
+}
+
+/*!
+ *
+ */
+void RadioStripBase::setAutoCenter( bool autoCenter )
+{
+    mAutoCenter = autoCenter;
+}
+
+/*!
+ *
+ */
+void RadioStripBase::setItemSize( const QSizeF& size )
+{
+    if ( mItemSize != size ) {
+        mItemSize = size;
+
+        prepareGeometryChange();
+
+        populateAndLayout();
+
+        update();
+        updateGeometry();
+    }
+}
+
+/*!
+ *
+ */
+void RadioStripBase::setIndex( int index, bool animateToCenter )
+{
+    Q_UNUSED( animateToCenter )
+    // Sanity checks
+    if ( !mModel || ( !mIsCyclic && ( index < 0 || index >= mModel->rowCount() ) ) ) {
+        return;
+    }
+
+    const int oldIndex = mCurrentIndex;
+    if ( mIsCyclic )
+    {
+        int numRows = mModel->rowCount();
+        index = (index + numRows) % numRows;
+    }
+    Q_ASSERT( index >= 0 );
+
+    mCurrentIndex = index;
+
+    updateItemWithIndex( mCurrentIndex );
+    updateItemWithIndex( oldIndex );
+}
+
+/*!
+ * \reimp
+ */
+void RadioStripBase::resizeEvent( QGraphicsSceneResizeEvent* event )
+{
+    Q_UNUSED( event );
+    populateAndLayout();
+}
+
+/*!
+ * \reimp
+ */
+void RadioStripBase::mousePressEvent( QGraphicsSceneMouseEvent* event )
+{
+    if ( event->button() != Qt::LeftButton || !mModel || !mModel->rowCount() )
+    {
+        event->ignore();
+        return;
+    }
+
+    HbScrollArea::mousePressEvent( event );
+}
+
+/*!
+ * \reimp
+ */
+void RadioStripBase::mouseReleaseEvent( QGraphicsSceneMouseEvent* event )
+{
+    if ( event->button() != Qt::LeftButton )
+    {
+        event->ignore();
+        return;
+    }
+
+    HbScrollArea::mouseReleaseEvent( event );
+}
+
+/*!
+ * Private slot
+ */
+void RadioStripBase::scrollPositionChanged( QPointF newPosition )
+{
+    adjustItems();
+    scrollPosChanged( newPosition );
+}
+
+/*!
+ *
+ */
+void RadioStripBase::moveAllItemsToPool()
+{
+    // set parent of all items to pool
+    foreach( QGraphicsItem* item, mItemAtSlot )
+    {
+        item->setParentItem( mItemPoolParent );
+    }
+
+    // move all items to pool
+    mItemPool += mItemAtSlot;
+    mItemAtSlot.clear();
+    mIndexAtSlot.clear();
+}
+
+/*!
+ *
+ */
+void RadioStripBase::populateAndLayout()
+{
+    moveAllItemsToPool();
+
+    if ( !mModel || mModel->rowCount() == 0 )
+    {
+        return;
+    }
+
+    mStripLength = boundingRect().width();
+    qreal itemSize = mItemSize.width();
+    mContentsLength = mModel->rowCount() * (itemSize + mSpacing) + mSpacing;
+
+    if ( mIsCyclic )
+    {
+        // if treating the items cyclically, double the content area so it can
+        // be shifted back and forth as you scroll
+        mContentsLength = mModel->rowCount() * (itemSize + mSpacing);
+        mContentsLength *= 2.0;
+    }
+
+    qreal currPos = mSpacing;
+    for ( int i = 0; i < mModel->rowCount(); ++i ) {
+        if ( currPos > mStripLength )
+        {
+            break;
+        }
+
+        QGraphicsItem* item = constructItem( i, true );
+        if ( item )
+        {
+            item->setPos( QPointF( currPos, mSpacing ) );
+            currPos += itemSize + mSpacing;
+        }
+    }
+
+    QRectF contentsRect(0,0,0,0);
+    contentsRect.setBottom( itemSize + 2 * mSpacing );
+    contentsRect.setRight( mContentsLength );
+
+    mStripContainer->setGeometry( contentsRect );
+
+    if ( mCurrentIndex >= 0 )
+    {
+        setIndex( mCurrentIndex, false );
+    }
+}
+
+/*!
+ *
+ */
+QGraphicsItem* RadioStripBase::constructItem( int index, bool append )
+{
+    QGraphicsItem* item = getFromPool();
+
+    if ( mIsCyclic )
+    {
+        Q_ASSERT( index >= 0 && index < 2 * mModel->rowCount() );
+
+        updateItemPrimitive( item, index % mModel->rowCount() );
+    }
+    else
+    {
+        Q_ASSERT( index >= 0 && index < mModel->rowCount() );
+
+        updateItemPrimitive( item, index );
+    }
+
+    item->setParentItem( mStripContainer );
+
+    if ( append )
+    {
+        mItemAtSlot.append( item );
+        mIndexAtSlot.append( index );
+    }
+    else
+    {
+        mItemAtSlot.prepend( item );
+        mIndexAtSlot.prepend( index );
+    }
+
+    return item;
+}
+
+/*!
+ *
+ */
+QGraphicsItem* RadioStripBase::getFromPool()
+{
+    QGraphicsItem* item = 0;
+
+    if ( mItemPool.isEmpty() )
+    {
+        item = createItemPrimitive( this );
+    }
+    else
+    {
+        item = mItemPool.takeFirst();
+    }
+
+    return item;
+}
+
+/*!
+ *
+ */
+void RadioStripBase::returnToPool( QGraphicsItem* item )
+{
+    // Unparent the item so it doesn't get deleted
+    item->setParentItem( mItemPoolParent );
+    mItemPool.append( item );
+}
+
+/*!
+ * Returns starting coordinate of the item with the specified index
+ */
+qreal RadioStripBase::indexToOffset( int index )
+{
+    return index * ( mItemSize.width() + mSpacing ) + mSpacing;
+}
+
+/*!
+ * Returns item index for specified offset amount into the content
+ */
+int RadioStripBase::offsetToIndex( qreal offset )
+{
+    const int rows = mModel->rowCount();
+    int index = (int)( ( offset - mSpacing) / ( mItemSize.width() + mSpacing ) );
+
+    if ( mIsCyclic )
+    {
+       return qBound( 0, index, 2 * rows - 1 );
+    }
+
+    return qBound( 0, index, rows - 1 );
+}
+
+/*!
+ * updates items with specified index value
+ */
+void RadioStripBase::updateItemWithIndex( int index )
+{
+    if( index >= 0 )
+    {
+        QList<QGraphicsItem *>::const_iterator item = mItemAtSlot.constBegin();
+        QList<QGraphicsItem *>::const_iterator itemsEnd = mItemAtSlot.constEnd();
+        QList<int>::const_iterator itemIndex = mIndexAtSlot.constBegin();
+        const int rowCount = mModel->rowCount();
+
+        // Find all items with this index (can be 2 in special cycling case)
+        for( ; item != itemsEnd; ++item, ++itemIndex )
+        {
+            if( index == *itemIndex || index == *itemIndex - rowCount )
+            {
+                // update those items
+                updateItemPrimitive( *item, index );
+            }
+        }
+    }
+}
+
+/*!
+ * Updates items during scrolling: removing invisible items and adding items that became visible
+ */
+void RadioStripBase::adjustItems()
+{
+    qreal contentPos = mStripContainer->pos().x();
+
+    if ( mIsCyclic )
+    {
+        if ( -contentPos < 0 )
+        {
+            // trying  to display off the left end of the strip, so
+            // shift the strip one length to the left
+            contentPos -= mContentsLength * 0.5;
+            mStripContainer->setPos( QPointF ( contentPos, mStripContainer->pos().y() ) );
+        } else if (-contentPos > mContentsLength * 0.5) {
+            // trying to display off the right end of the strip, so
+            // shift the strip one length to the right
+            contentPos += mContentsLength * 0.5;
+            mStripContainer->setPos( QPointF ( contentPos, mStripContainer->pos().y() ) );
+        }
+    }
+
+    // find the first and last indices of the visible items
+    int firstVisibleIndex = offsetToIndex( -contentPos );
+    int lastVisibleIndex = offsetToIndex( -contentPos + mStripLength );
+
+    // remove items at the start that are no longer visible
+    while ( !mIndexAtSlot.isEmpty() )
+    {
+        int firstSlotIndex = mIndexAtSlot.first();
+        if ( firstVisibleIndex <= firstSlotIndex )
+        {
+            break;
+        }
+
+        returnToPool( mItemAtSlot.first() );
+        mItemAtSlot.removeFirst();
+        mIndexAtSlot.removeFirst();
+    }
+
+    // remove items at the end that are no longer visible
+    while ( !mIndexAtSlot.isEmpty() )
+    {
+        int lastSlotIndex = mIndexAtSlot.last();
+        if ( lastVisibleIndex >= lastSlotIndex )
+        {
+            break;
+        }
+
+        returnToPool( mItemAtSlot.last() );
+        mItemAtSlot.removeLast();
+        mIndexAtSlot.removeLast();
+    }
+
+    if ( mItemAtSlot.isEmpty() )
+    {
+        // fill area with all needed items
+        for ( int i = firstVisibleIndex; i <= lastVisibleIndex; ++i )
+        {
+            QGraphicsItem* item = constructItem( i, true );
+            if ( item )
+            {
+                item->setPos( QPointF( indexToOffset( i ), mSpacing ) );
+            }
+        }
+    }
+    else
+    {
+        // add missing items at the front
+        int firstItemToCreate = mIndexAtSlot.first()-1;
+        for ( int i = firstItemToCreate; i >= firstVisibleIndex; --i )
+        {
+            QGraphicsItem* item = constructItem( i, false );
+            if ( item )
+            {
+                item->setPos( QPointF( indexToOffset( i ), mSpacing ) );
+            }
+        }
+
+        // add missing items at the end
+        firstItemToCreate = mIndexAtSlot.last()+1;
+        for ( int i = firstItemToCreate; i <= lastVisibleIndex; ++i )
+        {
+            QGraphicsItem* item = constructItem( i, true );
+            if ( item )
+            {
+                item->setPos( QPointF( indexToOffset( i ), mSpacing ) );
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/src/radiouiloader.cpp	Fri Jun 04 10:21:36 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:
+*
+*/
+
+// User includes
+#include "radiouiloader.h"
+
+/*!
+ *
+ */
+RadioUiLoader::RadioUiLoader() :
+    HbDocumentLoader()
+{
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/src/radiouiutilities.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,137 @@
+/*
+* 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:
+*
+*/
+
+// System includes
+#include <HbEffect>
+
+// User includes
+#include "radiouiutilities.h"
+#include "radiofrequencystrip.h"
+#include "radiostationcarousel.h"
+#include "radiofrequencyscanner.h"
+#include "radiologger.h"
+
+// Constants
+
+static RadioUiUtilities* theInstance = 0;
+
+/*!
+ *
+ */
+RadioUiUtilities::RadioUiUtilities()
+{
+}
+
+/*!
+ *
+ */
+RadioUiUtilities::~RadioUiUtilities()
+{
+}
+
+/*!
+ *
+ */
+bool RadioUiUtilities::addEffects( QEffectList list )
+{
+    bool allAvailable = true;
+    QEffectList added;
+    foreach ( EffectInfo info, list ) {
+#ifdef USE_LAYOUT_FROM_E_DRIVE
+        info.mPath.replace( QString( ":/" ), QString( "e:/radiotest/" ) );
+#endif
+        if ( HbEffect::add( info.mItem, info.mPath, info.mEvent ) ) {
+            added.append( info );
+        } else {
+            allAvailable = false;
+            break;
+        }
+    }
+
+    if ( !allAvailable ) {
+        foreach ( const EffectInfo& info, added ) {
+            HbEffect::remove( info.mItem, info.mPath, info.mEvent );
+        }
+    }
+
+    return allAvailable;
+}
+
+
+/*!
+ *
+ */
+RadioFrequencyStrip* RadioUiUtilities::frequencyStrip()
+{
+    return instance().mFrequencyStrip;
+}
+
+/*!
+ *
+ */
+RadioStationCarousel* RadioUiUtilities::carousel()
+{
+    return instance().mCarousel;
+}
+
+/*!
+ *
+ */
+bool RadioUiUtilities::isScannerAlive()
+{
+    RadioFrequencyScanner* scanner = instance().mScanner;
+    if ( scanner ) {
+        return scanner->isAlive();
+    }
+    return false;
+}
+
+/*!
+ *
+ */
+void RadioUiUtilities::setFrequencyStrip( RadioFrequencyStrip* frequencyStrip )
+{
+    instance().mFrequencyStrip = frequencyStrip;
+}
+
+/*!
+ *
+ */
+void RadioUiUtilities::setCarousel( RadioStationCarousel* carousel )
+{
+    instance().mCarousel = carousel;
+}
+
+/*!
+ *
+ */
+void RadioUiUtilities::setFrequencyScanner( RadioFrequencyScanner* scanner )
+{
+    instance().mScanner = scanner;
+}
+
+/*!
+ *
+ */
+RadioUiUtilities& RadioUiUtilities::instance()
+{
+    if ( !::theInstance ) {
+        ::theInstance = new RadioUiUtilities;
+    }
+    return *::theInstance;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/src/radioviewbase.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,219 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <HbMenu>
+#include <HbAction>
+#include <HbEffect>
+#include <QCoreApplication>
+#include <HbMessageBox>
+
+#include "radioviewbase.h"
+#include "radiowindow.h"
+#include "radiostationmodel.h"
+#include "radiouiloader.h"
+#include "radiouiengine.h"
+#include "radiologger.h"
+
+/*!
+ *
+ */
+RadioViewBase::RadioViewBase( bool transient ) :
+    HbView( 0 ),
+    mMainWindow( 0 ),
+    mUiLoader( 0 ),
+    mInitialized( false ),
+    mTransientView( transient ),
+    mUseLoudspeakerAction( 0 ),
+    mOrientation( Qt::Vertical )
+{
+}
+
+/*!
+ *
+ */
+RadioViewBase::~RadioViewBase()
+{
+    if ( mUiLoader ) {
+        mUiLoader->reset();
+    }
+}
+
+/*!
+ *
+ */
+void RadioViewBase::setMembers( RadioUiLoader* uiLoader, RadioWindow* mainWindow )
+{
+    mUiLoader.reset( uiLoader );
+    mMainWindow = mainWindow;
+}
+
+/*!
+ *
+ */
+bool RadioViewBase::isInitialized() const
+{
+    return mInitialized;
+}
+
+/*!
+ *
+ */
+bool RadioViewBase::isTransient() const
+{
+    return mTransientView;
+}
+
+/*!
+ *
+ */
+void RadioViewBase::updateOrientation( Qt::Orientation orientation, bool forceUpdate )
+{
+    if ( orientation != mOrientation || forceUpdate ) {
+        mOrientation = orientation;
+        setOrientation();
+    }
+}
+
+/*!
+ * Protected slot
+ *
+ */
+void RadioViewBase::updateAudioRouting( bool loudspeaker )
+{
+    if ( mUseLoudspeakerAction ) {
+        mUseLoudspeakerAction->setText( loudspeaker ? hbTrId( "txt_common_opt_deactivate_loudspeaker" )
+                                                    : hbTrId( "txt_common_opt_activate_loudspeaker" ) );
+    }
+}
+
+/*!
+ * Protected slot
+ *
+ */
+void RadioViewBase::activatePreviousView()
+{
+    mMainWindow->activateMainView();
+}
+
+/*!
+ * Protected slot
+ *
+ */
+void RadioViewBase::quit()
+{
+    qApp->quit();
+}
+
+/*!
+ * Private slot
+ * TODO: Refactor this awkwardness once Orbit figures out a better way
+ */
+void RadioViewBase::handleUserAnswer( HbAction* answer )
+{
+    HbMessageBox* dlg = static_cast<HbMessageBox*>( sender() );
+    if( dlg->actions().first() == answer ) {
+        userAccepted();
+    }
+}
+
+/*!
+ *
+ */
+void RadioViewBase::initBackAction()
+{
+    // The default back button activates the tuning view
+    HbAction* backAction = new HbAction( Hb::BackNaviAction, this );
+    connectAndTest( backAction,     SIGNAL(triggered()),
+                    mMainWindow,    SLOT(activateMainView()) );
+    setNavigationAction( backAction );    
+}
+
+/*!
+ *
+ */
+void RadioViewBase::connectCommonMenuItem( int menuItem )
+{
+    RadioUiEngine* engine = &mMainWindow->uiEngine();
+    switch ( menuItem ) {
+        case MenuItem::UseLoudspeaker:
+            mUseLoudspeakerAction = mUiLoader->findObject<HbAction>( DOCML::NAME_LOUDSPEAKER_ACTION );
+            if ( mUseLoudspeakerAction ) {
+                connectAndTest( mUseLoudspeakerAction, SIGNAL(triggered()), engine, SLOT(toggleAudioRoute()) );
+                updateAudioRouting( engine->isUsingLoudspeaker() );
+                connectAndTest( engine, SIGNAL(audioRouteChanged(bool)), this, SLOT(updateAudioRouting(bool)) );
+            }
+            break;
+
+        default:
+            break;
+    }
+}
+
+/*!
+ *
+ */
+void RadioViewBase::connectXmlElement( const char* name, const char* signal, QObject* receiver, const char* slot )
+{
+    if ( QObject* action = mUiLoader->findObject<QObject>( name ) ) {
+        connectAndTest( action, signal, receiver, slot );
+    }
+}
+
+/*!
+ *
+ */
+void RadioViewBase::connectViewChangeMenuItem( QString name, const char* slot )
+{
+    if ( QObject* action = mUiLoader->findObject<QObject>( name ) ) {
+        connectAndTest( action, SIGNAL(triggered()), mMainWindow, slot );
+    }
+}
+
+/*!
+ *
+ */
+void RadioViewBase::loadSection( const QString& docml, const QString& section )
+{
+    LOG_FORMAT( "RadioViewBase::loadSection: Docml: %s, section: %s", GETSTRING( docml ), GETSTRING( section ) );
+    bool ok = false;    
+    mUiLoader->load( docml, section, &ok );
+    LOG_ASSERT( ok, LOG_FORMAT( "Loading of section %s failed!", GETSTRING( section ) ) );
+}
+
+/*!
+ *
+ */
+void RadioViewBase::askQuestion( const QString& question )
+{
+    HbMessageBox::question( question, this, SLOT(handleUserAnswer(HbAction*)) );
+}
+
+/*!
+ *
+ */
+void RadioViewBase::setOrientation()
+{
+    // Default implementation does nothing
+}
+
+/*!
+ *
+ */
+void RadioViewBase::userAccepted()
+{
+    // Default implementation does nothing
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgets/src/radiowindow.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,244 @@
+/*
+* 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:
+*
+*/
+
+// System includes
+#include <HbInstance>
+#include <HbAction>
+#include <HbDeviceMessageBox>
+#include <HbVolumeSliderPopup>
+
+// User includes
+#include "radiowindow.h"
+#include "radiomainview.h"
+#include "radiostationsview.h"
+#include "radiouiengine.h"
+#include "radiostationmodel.h"
+#include "radiologger.h"
+#include "radiouiloader.h"
+
+// Constants
+
+/**
+ * Desired amount of delay of volumesliderpopup
+ */
+const int KVolumeSliderDelay = 5000;
+
+/*!
+ *
+ */
+RadioWindow::RadioWindow( QWidget* parent ) :
+    HbMainWindow( parent ),
+    mUiEngine( new RadioUiEngine( this ) )
+{
+}
+
+/*!
+ *
+ */
+RadioWindow::~RadioWindow()
+{
+    // Destructor needs to be defined. See explanation from RadioEngineWrapperPrivate destructor.
+}
+
+/*!
+ *
+ */
+void RadioWindow::showErrorMessage( const QString& text )
+{
+    HbDeviceMessageBox box( text, HbMessageBox::MessageTypeWarning );
+    box.setTimeout( HbPopup::NoTimeout );
+    box.setDismissPolicy( HbPopup::NoDismiss );
+    box.exec();
+}
+
+/*!
+ *
+ */
+void RadioWindow::init()
+{
+    connectAndTest( this, SIGNAL(viewReady()),
+                    this, SLOT(initView()) );
+
+    activateMainView();
+}
+
+/*!
+ *
+ */
+RadioUiEngine& RadioWindow::uiEngine()
+{
+    return *mUiEngine;
+}
+
+/*!
+ * Returns the XML layout section that corresponds to the view orientation
+ */
+QString RadioWindow::orientationSection()
+{
+    return orientation() == Qt::Vertical ? DOCML::SECTION_PORTRAIT : DOCML::SECTION_LANDSCAPE;
+}
+
+/*!
+ *
+ */
+void RadioWindow::activateMainView()
+{
+    activateView( mMainView, DOCML::FILE_MAINVIEW, Hb::ViewSwitchUseBackAnim );
+}
+
+/*!
+ *
+ */
+void RadioWindow::activateStationsView()
+{
+    activateView( mStationsView, DOCML::FILE_STATIONSVIEW );
+}
+
+/*!
+ *
+ */
+void RadioWindow::activateHistoryView()
+{
+    activateView( mHistoryView, DOCML::FILE_HISTORYVIEW );
+}
+
+/*!
+ * Private slot
+ *
+ */
+void RadioWindow::initView()
+{
+    if ( !mUiEngine->isInitialized() ) {
+        // Start the engine
+        if ( !mUiEngine->init() ) {
+            showErrorMessage( hbTrId( "txt_fmradio_info_fm_radio_could_not_be_started" ) );
+            qApp->quit();
+            return;
+        }
+
+        // MainWindow is the one that always listens for orientation changes and then delegates
+        // the updates to the views
+        connectAndTest( this,               SIGNAL(orientationChanged(Qt::Orientation)),
+                        this,               SLOT(updateOrientation(Qt::Orientation)) );
+
+        connectAndTest( mUiEngine.data(),   SIGNAL(volumeChanged(int)),
+                        this,               SLOT(showVolumeLevel(int)) );
+        connectAndTest( mUiEngine.data(),   SIGNAL(antennaStatusChanged(bool)),
+                        this,               SLOT(updateAntennaStatus(bool)) );
+    }
+
+    RadioViewBase* view = static_cast<RadioViewBase*>( currentView() );
+    if ( !view->isInitialized() ) {
+        view->init();
+    }
+}
+
+/*!
+ * Private slot
+ *
+ */
+void RadioWindow::updateOrientation( Qt::Orientation orientation )
+{
+    HbView* view = currentView();
+    RADIO_ASSERT( view, "RadioWindow::updateOrientation", "Current view not found!" );
+    if ( view ) {
+        static_cast<RadioViewBase*>( view )->updateOrientation( orientation );
+    }
+}
+
+/*!
+ * Private slot
+ *
+ */
+void RadioWindow::showVolumeLevel( int volume )
+{
+    if ( !mVolSlider ) {
+        mVolSlider.reset( new HbVolumeSliderPopup() );
+        mVolSlider->setRange( 0, KMaximumVolumeLevel );
+        mVolSlider->setSingleStep( 1 );
+        mVolSlider->setTimeout( KVolumeSliderDelay );
+        connectAndTest( mVolSlider.data(),  SIGNAL(valueChanged(int)),
+                        mUiEngine.data(),   SLOT(setVolume(int)) );
+    }
+
+    mVolSlider->setValue( volume );
+    mVolSlider->setText( QString( "%L1%" ).arg( volume * 100 / KMaximumVolumeLevel ) );
+    mVolSlider->show();
+}
+
+/*!
+ * Private slot
+ *
+ */
+void RadioWindow::updateAntennaStatus( bool connected )
+{
+    if ( !connected ) {
+        HbMessageBox::information( hbTrId( "txt_rad_dpophead_connect_wired_headset" ) );
+    }
+}
+
+/*!
+ *
+ */
+void RadioWindow::activateView( ViewPtr& aMember, const QString& docmlFile, Hb::ViewSwitchFlags flags )
+{
+    LOG_METHOD;
+    if ( aMember && aMember == currentView() ) {
+        return;
+    }
+
+    RadioViewBase* previousView = static_cast<RadioViewBase*>( currentView() );
+    if ( previousView && previousView->isTransient() ) {
+        removeView( previousView );
+        previousView->deleteLater();
+    }
+
+    bool viewCreated = false;
+    if ( !aMember ) {
+        viewCreated = true;
+
+        RadioUiLoader* uiLoader = new RadioUiLoader();
+        bool ok = false;
+
+        // View takes ownership of the ui loader when it is created inside the load function
+        QObjectList objectList = uiLoader->load( docmlFile, &ok );
+
+        RADIO_ASSERT( ok , "FMRadio", "invalid DocML file" );
+        if ( !ok ) {
+            delete uiLoader;
+            uiLoader = 0;
+            return;
+        }
+
+        aMember = ViewPtr( uiLoader->findObject<RadioViewBase>( DOCML::NAME_VIEW ) );
+
+        foreach( QObject* object, objectList ) {
+            const QString className = object->metaObject()->className();
+            if ( !object->parent() && object != aMember.data() ) {
+                object->setParent( aMember.data() );
+            }
+        }
+
+        aMember->setMembers( uiLoader, this );
+
+        addView( aMember );
+    }
+
+    aMember->updateOrientation( orientation(), viewCreated );
+
+    setCurrentView( aMember, true, flags );
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgetsplugin/main.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// System includes
+#include <QtPlugin>
+#include <hbdocumentloaderplugin>
+
+// User includes
+#include "radiostationsview.h"
+#include "radiomainview.h"
+#include "radiohistoryview.h"
+#include "radiostationcarousel.h"
+#include "radiofrequencystrip.h"
+#include "radiobannerlabel.h"
+#include "radiofadinglabel.h"
+
+// Class declaration
+class RadioWidgetsPlugin : public HbDocumentLoaderPlugin
+{
+public:
+
+    QObject* createObject(const QString& type, const QString& name);
+    QList<const QMetaObject*> supportedObjects();
+
+};
+
+Q_EXPORT_PLUGIN(RadioWidgetsPlugin)
+
+/*!
+ *
+ */
+QObject* RadioWidgetsPlugin::createObject( const QString& type, const QString& name )
+{
+    QObject* object = 0;
+
+    if ( type == RadioMainView::staticMetaObject.className() ) {
+        object = new RadioMainView();
+    } else if ( type == RadioStationsView::staticMetaObject.className() ) {
+        object = new RadioStationsView();
+    } else if ( type == RadioHistoryView::staticMetaObject.className() ) {
+        object = new RadioHistoryView();
+    } else if ( type == RadioStationCarousel::staticMetaObject.className() ) {
+        object = new RadioStationCarousel();
+    } else if ( type == RadioFrequencyStrip::staticMetaObject.className() ) {
+        object = new RadioFrequencyStrip();
+    } else if ( type == RadioBannerLabel::staticMetaObject.className() ) {
+        object = new RadioBannerLabel();
+    } else if ( type == RadioFadingLabel::staticMetaObject.className() ) {
+        object = new RadioFadingLabel();
+    }
+
+    if ( object ) {
+        object->setObjectName( name );
+    }
+
+    return object;
+}
+
+/*!
+ *
+ */
+QList<const QMetaObject *> RadioWidgetsPlugin::supportedObjects()
+{
+    QList<const QMetaObject *> result;
+    result.append( &RadioMainView::staticMetaObject );
+    result.append( &RadioStationsView::staticMetaObject );
+    result.append( &RadioHistoryView::staticMetaObject );
+    result.append( &RadioBannerLabel::staticMetaObject );
+    result.append( &RadioFadingLabel::staticMetaObject );
+    result.append( &RadioFrequencyStrip::staticMetaObject );
+    result.append( &RadioStationCarousel::staticMetaObject );
+    return result;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioapp/radiowidgetsplugin/radiowidgetsplugin.pro	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,41 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+TEMPLATE    = lib
+TARGET      = radiowidgetsplugin
+
+win32: {
+    DESTDIR = ../bin
+    LIBS    += -L../bin
+}
+
+CONFIG      += hb plugin
+QT          += core
+
+INCLUDEPATH += ../radiowidgets/inc
+INCLUDEPATH += ../commoninc
+
+symbian: {
+    TARGET.EPOCALLOWDLLDATA = 1
+    TARGET.CAPABILITY       = CAP_GENERAL_DLL
+    pluginstub.sources      = radiowidgetsplugin.dll
+    pluginstub.path         = /resource/plugins
+    DEPLOYMENT              += pluginstub
+}
+
+SOURCES     += main.cpp
+
+LIBS        += -lradiowidgets
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/engine/api/cradioengine.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,315 @@
+/*
+* 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 CRADIOENGINE_H_
+#define CRADIOENGINE_H_
+
+// User includes
+#include "cradioroutableaudio.h"
+#include "radioenginedef.h"
+#include "radioengine.hrh"
+
+// Forward declarations
+class MRadioEngineInitializer;
+class CRadioAudioRouter;
+class CRadioSettings;
+class MRadioApplicationSettings;
+class MRadioEngineSettings;
+class CRadioSystemEventCollector;
+class CRadioPubSub;
+class CRadioRepositoryManager;
+class MRadioPresetSettings;
+class MRadioSettingsSetter;
+class MRadioScanObserver;
+class MRadioEngineObserver;
+class MRadioRdsReceiver;
+
+/**
+ * Convenience class to handle engine startup and the ownership of the related classes
+ */
+NONSHARABLE_CLASS( CRadioEngine ) : public CRadioRoutableAudio
+    {
+public:
+
+    /**
+     * Starts the radio engine initialization.
+     * Asks the given initializer to create the member variables
+     */
+    IMPORT_C static CRadioEngine* NewL( MRadioEngineInitializer& aInitializer );
+
+    IMPORT_C ~CRadioEngine();
+
+    /**
+     * Returns a reference to the audio router
+     *
+     * @return  Reference to the audio router
+     */
+    virtual CRadioAudioRouter& AudioRouter() const = 0;
+
+    /**
+     * Returns the system event collector
+     *
+     * @return  The system event collector
+     */
+    virtual CRadioSystemEventCollector& SystemEventCollector() const = 0;
+
+    /**
+     * Returns a reference to the application settings
+     *
+     * @return  Reference to the application settings
+     */
+    virtual CRadioSettings& Settings() const = 0;
+
+    /**
+     * Returns a reference to the publish & subscribe handler
+     *
+     * @return  Reference to the publish & subscribe handler
+     */
+    virtual CRadioPubSub* PubSub() const = 0;
+
+    /**
+     * Determines radio region
+     */
+    virtual TRadioRegion DetermineRegion() = 0;
+
+    /**
+     * ( Re )initializes the radio.
+     *
+     * @param aRegionId Region id
+     * @param aPubSub   Pointer to Publish&Subscribe object
+     */
+    virtual void InitRadioL( TInt aRegionId, CRadioPubSub* aPubSub = 0 ) = 0;
+
+    /**
+     * Has the radio been initialized
+     *
+     * @return ETrue if radio is initialized, otherwise EFalse
+     */
+    virtual TBool RadioInitialized() const = 0;
+
+    /**
+     * Sets the state for radio audio
+     * This is the public interface to manage radio power state
+     * This method should be called before radio can turn itself on
+     *
+     * @param aEnable ETrue if radio audio can be played,
+     *                EFalse if audio should be disabled
+     * @param aDelay  ETrue if radio is played/disabled with delay
+     *                EFalse if radio is played/disabled without delay
+     */
+    virtual void EnableAudio( TBool aEnable, TBool aDelay = ETrue ) = 0;
+
+    /**
+     * Gets the state for radio audio.
+     *
+     * This returns the information if radio could be played when
+     * other conditions are valid. This should be false only when
+     * some other application has cause disabling of auto resume.
+     *
+     * @return ETrue if radio audio could be played,
+     *         EFalse if radio audio couldn't be played
+     */
+    virtual TBool RadioAudioEnabled() const = 0;
+
+    /**
+     * Sets the audio overriding flag
+     *
+     * @param aOverride ETrue if other audio resources are tried to be overriden.
+     */
+    virtual void SetAudioOverride( TBool aOverride ) = 0;
+
+    /**
+     * Adds an observer wich will be notified of the radio state changes
+     * If observer already exists, it is not added
+     *
+     * @param aObserver pointer of the observer instance.
+     */
+    virtual void AddObserverL( MRadioEngineObserver* aObserver ) = 0;
+
+    /**
+     * Removes a radio state change observer.
+     */
+    virtual void RemoveObserver( MRadioEngineObserver* aObserver ) = 0;
+
+    /**
+     * Sets audio mode ( Stereo/Mono )
+     *
+     * @param aAudioMode actual new radio mode
+     */
+    virtual void SetAudioMode( TInt aAudioMode ) = 0;
+
+    /**
+     * Compares if frequency is within limits range.
+     *
+     * @param aFrequency The frequency that is checked.
+     *                   If omitted, current frequency is checked.
+     * @return ETrue, if frequency is within radio range.
+     */
+    virtual TBool IsFrequencyValid( TUint32 aFrequency = 0 ) const = 0;
+
+    /**
+     * Tunes to frequency
+     * If radio is not initialized by InitRadioL, frequency is just
+     * set to settings.
+     *
+     * @param aFrequency frequency to tune to
+     * @param aReason reason for the frequency setting
+     */
+    virtual void SetFrequency( TUint32 aFrequency,
+            RadioEngine::TRadioFrequencyEventReason aReason = RadioEngine::ERadioFrequencyEventReasonUnknown ) = 0;
+
+    /**
+     * Test function to try to make the tuning as fast as possible.
+     * Use with care since this will skip a lot of checks done by the SetFrequency() function
+     */
+    virtual void SetFrequencyFast( TUint32 aFrequency,
+            RadioEngine::TRadioFrequencyEventReason aReason = RadioEngine::ERadioFrequencyEventReasonUnknown ) = 0;
+
+    /**
+     * Steps to next frequency according to direction
+     *
+     * @param aDirection The direciton to step to
+     */
+    virtual void StepToFrequency( RadioEngine::TRadioTuneDirection aDirection ) = 0;
+
+    /**
+     * Performs seeking operation.
+     *
+     * @param aDirection direction of seeking operation.
+     */
+    virtual void Seek( RadioEngine::TRadioTuneDirection aDirection ) = 0;
+
+    /**
+     * Cancels an ongoing request to seek up/down.
+     */
+    virtual void CancelSeek() = 0;
+
+    /**
+     * Is the radio seeking up/down, or at all.
+     *
+     * @return Seeking state.
+     */
+    virtual RadioEngine::TRadioSeeking Seeking() const = 0;
+
+    /**
+     * Starts scanning all available stations from the minimum frequency
+     *
+     * Calling this method also cancels any existing scan or seek operations.
+     *
+     * @param   aObserver       Observer to be notified of the progress of the scan.
+     *                          If a scan is currently in progress or the radio is not on, then
+     *                          the new scan is not performed at all and an error is passed on completion event.
+     *
+     */
+    virtual void StartScan( MRadioScanObserver& aObserver ) = 0;
+
+    /**
+     * Stops any scans currently in progress and notifies the observer
+     *
+     * @param aError The error code for completing the scanning.
+     */
+    virtual void StopScan( TInt aError = KErrCancel ) = 0;
+
+    /**
+     * Changes volume by one level.
+     *
+     * @param aDirection Direction of the volume change.
+     */
+    virtual void AdjustVolume( RadioEngine::TRadioVolumeSetDirection aDirection ) = 0;
+
+    /**
+     * Sets volume level
+     *
+     * @param aVolume new volume level.
+     */
+    virtual void SetVolume( TInt aVolume ) = 0;
+
+    /**
+     * Sets volume to be muted.
+     *
+     * @param aMute mute status.
+     */
+    virtual void SetVolumeMuted( TBool aMute ) = 0;
+
+    /**
+     * Retrieves current antenna state.
+     *
+     * @return ETrue if antenna is attached, EFalse otherwise.
+     */
+    virtual TBool IsAntennaAttached() = 0;
+
+    /**
+     * Retrieves current state of fm transmitter.
+     *
+     * @return ETrue if fm transmitter is active, EFalse otherwise.
+     */
+    virtual TBool IsFmTransmitterActive() const = 0;
+
+    /**
+     * Changes the antenna state.
+     * This should only be used when faking the antenna
+     * state in emulator environment.
+     * Thus this should work only in WINS.
+     *
+     * @param aAntennaAttached The new antenna state.
+     */
+    virtual void SetAntennaAttached( TBool aAntennaAttached ) = 0;
+
+    /**
+     * Returns the maximum volume level
+     *
+     * @return maximum volume level
+     */
+    virtual TInt MaxVolumeLevel() const = 0;
+
+    /**
+     * Has the frequency been set by RDS AF search or not.
+     *
+     * @return ETrue if frequency was set by RDS AF, otherwise EFalse
+     */
+    virtual TBool FrequencySetByRdsAf() const = 0;
+
+    /**
+     * Getter for RDS receiver
+     *
+     * @return Reference to CRadioRdsReceiver
+     */
+     virtual MRadioRdsReceiver& RdsReceiver() = 0;
+
+    /**
+     * Is routing between loudspeaker and headset possible
+     *
+     * @return ETrue, if routing is possible
+     */
+     virtual TBool IsAudioRoutingPossible() const = 0;
+
+    /**
+     * Checks if the radio playing parameters are OK
+     *
+     * @param aFrequency The frequency that is wanted to play.
+     * @return ETrue if audio can be played, otherwise EFalse
+     */
+    virtual TBool OkToPlay( TUint32 aFrequency ) const = 0;
+
+protected:
+
+    CRadioEngine( CRadioAudioRouter* aAudioRouter );
+
+    };
+
+#endif // CRADIOENGINE_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/engine/api/mradioengineinitializer.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#ifndef MRADIOENGINEINITIALIZER_H_
+#define MRADIOENGINEINITIALIZER_H_
+
+// System includes
+#include <e32std.h>
+
+// Forward declarations
+class CRadioAudioRouter;
+class CRadioSystemEventCollector;
+class CRadioSettings;
+class CRadioEngine;
+class CRadioPubSub;
+
+NONSHARABLE_CLASS( MRadioEngineInitializer )
+    {
+public:
+
+    virtual CRadioAudioRouter* InitAudioRouterL() = 0;
+    virtual CRadioSystemEventCollector* InitSystemEventCollectorL() = 0;
+    virtual CRadioSettings* InitSettingsL() = 0;
+    virtual CRadioPubSub* InitPubSubL() = 0;
+
+    };
+
+#endif // MRADIOENGINEINITIALIZER_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/engine/api/mradioengineobserver.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MRADIOENGINEOBSERVER_H
+#define MRADIOENGINEOBSERVER_H
+
+// User includes
+#include "radioenginedef.h"
+
+/**
+* Observer for radio state changes.
+*/
+NONSHARABLE_CLASS( MRadioEngineObserver )
+    {
+    public:
+
+    virtual void PowerEventL( TBool aPowerState, TInt aErrorCode ) = 0;
+
+    /**
+    * Notifies when frequency changes
+    * @param aFrequency The new frequency
+    * @param aReason reason why the frequency changed
+    * @param aErrorCode code related to state change
+    */
+    virtual void FrequencyEventL( TUint32 aFrequency, RadioEngine::TRadioFrequencyEventReason aReason, TInt aErrorCode ) = 0;
+    virtual void VolumeEventL( TInt aVolume, TInt aErrorCode ) = 0;
+    virtual void MuteEventL( TBool aMuteState, TInt aErrorCode ) = 0;
+    virtual void AudioModeEventL( TInt aAudioMode, TInt aErrorCode ) = 0;
+    virtual void AntennaEventL( TBool aAntennaAttached, TInt aErrorCode ) = 0;
+
+    /**
+    * Notifies when audio routing changes
+    * @param aAudioDestination The new output device
+    * @param aErrorCode Error code related to state change
+    */
+    virtual void AudioRoutingEventL( TInt aAudioDestination, TInt aErrorCode ) = 0;
+
+    /**
+    * Notifies about seeking events
+    * @param aSeekingState The seeking state
+    * @param aErrorCode KErrNone for successful starting or completion of seeking
+    */
+    virtual void SeekingEventL( TInt aSeekingState, TInt aErrorCode ) = 0;
+
+    /**
+     * Notifies about region changes
+     *
+     * @param aRegion The ID of the new region
+     * @param aErrorCode Region event error code
+     */
+    virtual void RegionEventL( TInt aRegion, TInt aErrorCode ) = 0;
+
+    /**
+     * Notifies about fm transmitter activating
+     */
+    virtual void FmTransmitterEventL( TBool aActive ) = 0;
+
+    };
+
+#endif // MRADIOENGINEOBSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/engine/api/mradiordsdataobserver.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,89 @@
+/*
+* 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 MRADIORDSDATAOBSERVER_H
+#define MRADIORDSDATAOBSERVER_H
+
+// System includes
+#include <e32std.h>
+
+// Class declaration
+NONSHARABLE_CLASS( MRadioRdsDataObserver )
+    {
+public:
+
+    /**
+     * Notifies of the status of RDS signal
+     */
+    virtual void RdsAvailable( TUint32 aFrequency, TBool aAvailable ) = 0;
+
+    /**
+     * Notifies of the beginning of Alternate Frequency search
+     */
+    virtual void RdsAfSearchBegin() = 0;
+
+    /**
+     * Notifies of the completed Alternate Frequency search
+     *
+     * @param aFrequency The new frequency
+     * @param aError A standard system error code
+     */
+    virtual void RdsAfSearchEnd( TUint32 aFrequency, TInt aError ) = 0;
+
+    /**
+     * Notifies of the changed Alternate Frequency search state
+     *
+     * @param aEnabled ETrue if AF search was enabled, otherwise EFalse
+     */
+    virtual void RdsAfSearchStateChange( TBool aEnabled ) = 0;
+
+    /**
+     * Programme Service data available
+     *
+     * @param aProgramService The new Programme Service data
+     */
+    virtual void RdsDataProgrammeService( TUint32 aFrequency, const TDesC& aProgramService ) = 0;
+
+    /**
+     * Radio text data available
+     *
+     * @param aRt The new radio text data
+     */
+    virtual void RdsDataRadioText( TUint32 aFrequency, const TDesC& aRt ) = 0;
+
+    /**
+     * Radio text plus data available.
+     *
+     * @param aRtPlusClass The class of the radio text plus data. Radio text plus classes are
+     *                     specified in TRdsRTplusClass enumeration.
+     * @param aRtPlusData The new radio text plus data.
+     */
+    virtual void RdsDataRadioTextPlus( TUint32 aFrequency, const TInt aRtPlusClass, const TDesC& aRtPlusData ) = 0;
+
+    /**
+     * Radio genre available
+     */
+    virtual void RdsDataGenre( TUint32 aFrequency, const TInt aGenre ) = 0;
+
+    /**
+     * Radio PI code available
+     */
+    virtual void RdsDataPiCode( TUint32 aFrequency, const TInt aPiCode ) = 0;
+
+    };
+
+#endif // MRADIORDSDATAOBSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/engine/api/mradiordsreceiver.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,99 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MRADIORDSRECEIVER_H
+#define MRADIORDSRECEIVER_H
+
+// Forward declarations
+class CRadioUtility;
+class CRadioPubSub;
+class MRadioRdsDataObserver;
+
+NONSHARABLE_CLASS( MRadioRdsReceiver )
+    {
+public:
+
+    /**
+     * Initializes the RDS receiver
+     *
+     * @param aRadioUtility A reference to the radio utility
+     * @param aPubSub       Pointer to Publish&Subscribe object
+     */
+    virtual void InitL( CRadioUtility& aRadioUtility, CRadioPubSub* aPubSub ) = 0;
+
+    /**
+     * Adds an observer wich will be notified of the new RDS data
+     * If observer already exists, it is not added
+     *
+     * @param aObserver pointer of the observer instance.
+     */
+    virtual void AddObserverL( MRadioRdsDataObserver* aObserver ) = 0;
+
+    /**
+     * Removes the rds observer.
+     */
+    virtual void RemoveObserver( MRadioRdsDataObserver* aObserver ) = 0;
+
+    /**
+     * Getter for automatic switching state of alternate frequencies
+     *
+     * @return ETrue if automatic switching is enabled
+     */
+    virtual TBool AutomaticSwitchingEnabled() const = 0;
+
+    /**
+     * Getter for the programme service name
+     *
+     * @return Programme service name
+     */
+    virtual const TDesC& ProgrammeService() const = 0;
+
+    /**
+     * Getter for the radio text.
+     *
+     * @return Radio text.
+     */
+    virtual const TDesC& RadioText() const = 0;
+
+    /**
+     * Getter for the RDS signal availability
+     *
+     * @return ETrue if RDS signal is available, otherwise EFalse
+     */
+    virtual TBool SignalAvailable() const = 0;
+
+    /**
+     * Setter for automatic switching of alternate frequencies
+     * If this method is overridden, the base implementation should be called
+     *
+     * @param aEnable ETrue, if automatic swithing is to be enabled
+     */
+    virtual void SetAutomaticSwitchingL( TBool aEnable ) = 0;
+
+    /**
+     * Starts receiving the RDS information
+     */
+    virtual void StartReceiver() = 0;
+
+    /**
+     * Stops receiving the RDS information
+     */
+    virtual void StopReceiver() = 0;
+
+    };
+
+#endif // MRADIORDSRECEIVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/engine/api/mradioscanobserver.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MRADIOSCANOBSERVER_H_
+#define MRADIOSCANOBSERVER_H_
+
+/**
+ * Interface for radio station scanning.
+ *
+ * Implementers of this interface are able to receive notifications
+ * when scanning finds a valid frequency and upon its completion.
+ */
+NONSHARABLE_CLASS( MRadioScanObserver )
+    {
+
+public:
+
+    /**
+     * Invoked when a frequency has been found with scanning.
+     *
+     * @param   aFrequency      The frequency, in kilohertz, that was found.
+     */
+    virtual void ScanFrequencyEventL( TUint32 aFrequency ) = 0;
+
+    /**
+     * Invoked when a scan has been completed.
+     *
+     * @param   aError      <code>KErrNone</code> when the scan was successfull,
+     *                      or any of the standard error codes otherwise.
+     */
+    virtual void ScanCompletedEventL( TInt aError ) = 0;
+
+    };
+
+#endif // MRADIOSCANOBSERVER_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/engine/bwins/radioengineu.def	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,4 @@
+EXPORTS
+	??1CRadioEngine@@UAE@XZ @ 1 NONAME ; CRadioEngine::~CRadioEngine(void)
+	?NewL@CRadioEngine@@SAPAV1@AAVMRadioEngineInitializer@@@Z @ 2 NONAME ; class CRadioEngine * CRadioEngine::NewL(class MRadioEngineInitializer &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/engine/eabi/radioengineu.def	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,6 @@
+EXPORTS
+	_ZN12CRadioEngine4NewLER23MRadioEngineInitializer @ 1 NONAME
+	_ZN12CRadioEngineD0Ev @ 2 NONAME
+	_ZN12CRadioEngineD1Ev @ 3 NONAME
+	_ZN12CRadioEngineD2Ev @ 4 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/engine/group/bld.inf	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "../../group/buildflags.hrh"
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+WINSCW ARMV5
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
+radioengine.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/engine/group/radioengine.mmp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "../../group/buildflags.hrh"
+
+#include <platform_paths.hrh>
+
+#include <data_caging_paths.hrh>
+
+TARGET                  radioengine.dll
+TARGETTYPE              DLL
+UID                     0x1000008D 0x10281CB2
+VERSION                 11.0
+
+CAPABILITY              CAP_GENERAL_DLL
+VENDORID                VID_DEFAULT
+
+PAGED
+
+SOURCEPATH              ../src
+SOURCE                  cradioengine.cpp
+SOURCE                  cradioengineimp.cpp
+SOURCE                  cradiordsreceiver.cpp
+SOURCE                  cradiordsreceiverbase.cpp
+SOURCE                  cradionetworkinfolistener.cpp
+
+#ifdef __FEATURE_RDS_SIMULATOR
+MACRO __FEATURE_RDS_SIMULATOR
+SOURCE                  t_cradiordsreceiversimulator.cpp
+#endif // __FEATURE_RDS_SIMULATOR
+
+USERINCLUDE             ../api
+USERINCLUDE             ../inc
+USERINCLUDE             ../../utils/api
+USERINCLUDE             ../../settings/api
+USERINCLUDE             ../../group
+
+// Default system include paths for application layer modules.
+APP_LAYER_SYSTEMINCLUDE
+
+LIBRARY                 radioengineutils.lib
+LIBRARY                 radioenginesettings.lib
+
+LIBRARY                 AudioOutputRouting.lib
+LIBRARY                 euser.lib
+LIBRARY                 efsrv.lib
+LIBRARY                 Radio_Utility.lib
+LIBRARY                 cone.lib
+LIBRARY                 etel3rdparty.lib            // For CTelephony
+LIBRARY                 etel.lib                    // For RTelServer
+LIBRARY                 etelmm.lib                  // For RMobilePhone
+LIBRARY                 commsdat.lib                // For CommsDat
+LIBRARY                 timezonelocalization.lib    // For CTzLocalizer
+LIBRARY                 bafl.lib                    // For CDesCArray
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/engine/inc/cradioengineimp.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,428 @@
+/*
+* 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 CRADIOENGINEIMP_H
+#define CRADIOENGINEIMP_H
+
+// System includes
+#include <RadioFmTunerUtility.h>
+#include <RadioPlayerUtility.h>
+#include <RadioUtility.h>
+
+// User includes
+#include "cradioengine.h"
+#include "mradiosettingsobserver.h"
+#include "mradiordsdataobserver.h"
+#include "mradiosystemeventobserver.h"
+#include "radioenginedef.h"
+
+// Forward declarations
+class CRadioPubSub;
+class CRadioRdsReceiverBase;
+class CRadioNetworkInfoListener;
+class MRadioEngineSettings;
+class MRadioSettingsSetter;
+class MRadioEngineObserver;
+class MRadioScanObserver;
+
+/**
+ * Radio class takes care of the FM-radio side.
+ */
+NONSHARABLE_CLASS( CRadioEngineImp ) : public CRadioEngine
+                                     , public MRadioSystemEventObserver
+                                     , public MRadioFmTunerObserver
+                                     , public MRadioPlayerObserver
+                                     , public MRadioSettingsObserver
+                                     , public MRadioRdsDataObserver
+    {
+    friend class CRadioEngine;
+
+public:
+
+    ~CRadioEngineImp();
+
+    void SetSystemEventCollector( CRadioSystemEventCollector* aCollector );
+    void SetRadioSettings( CRadioSettings* aSettings );
+    void SetRadioPubSub( CRadioPubSub* aPubSub );
+
+private:
+
+    CRadioEngineImp( CRadioAudioRouter* aAudioRouter );
+
+// from base class CRadioEngine
+
+    CRadioAudioRouter& AudioRouter() const;
+    CRadioSystemEventCollector& SystemEventCollector() const;
+    CRadioSettings& Settings() const;
+    CRadioPubSub* PubSub() const;
+    TRadioRegion DetermineRegion();
+    void InitRadioL( TInt aRegionId, CRadioPubSub* aPubSub = 0 );
+    TBool RadioInitialized() const;
+    void EnableAudio( TBool aEnable, TBool aDelay = ETrue );
+    TBool RadioAudioEnabled() const;
+    void SetAudioOverride( TBool aOverride );
+    void AddObserverL( MRadioEngineObserver* aObserver );
+    void RemoveObserver( MRadioEngineObserver* aObserver );
+    void SetAudioMode( TInt aAudioMode );
+    TBool IsFrequencyValid( TUint32 aFrequency = 0 ) const;
+    void SetFrequency( TUint32 aFrequency,
+            RadioEngine::TRadioFrequencyEventReason aReason = RadioEngine::ERadioFrequencyEventReasonUnknown );
+    void SetFrequencyFast( TUint32 aFrequency,
+            RadioEngine::TRadioFrequencyEventReason aReason = RadioEngine::ERadioFrequencyEventReasonUnknown );
+    void StepToFrequency( RadioEngine::TRadioTuneDirection aDirection );
+    void Seek( RadioEngine::TRadioTuneDirection aDirection );
+    void CancelSeek();
+    RadioEngine::TRadioSeeking Seeking() const;
+    void StartScan( MRadioScanObserver& aObserver );
+    void StopScan( TInt aError = KErrCancel );
+    void AdjustVolume( RadioEngine::TRadioVolumeSetDirection aDirection );
+    void SetVolume( TInt aVolume );
+    void SetVolumeMuted( TBool aMute );
+    TBool IsAntennaAttached();
+    TBool IsFmTransmitterActive() const;
+    void SetAntennaAttached( TBool aAntennaAttached );
+    TInt MaxVolumeLevel() const;
+    TBool FrequencySetByRdsAf() const;
+    MRadioRdsReceiver& RdsReceiver();
+    TBool IsAudioRoutingPossible() const;
+    TBool OkToPlay( TUint32 aFrequency ) const;
+
+private:
+
+    /** Radio event notifications */
+    enum TRadioEventNotification
+        {
+        ERadioEventPower = 1,
+        ERadioEventFrequency,
+        ERadioEventVolume,
+        ERadioEventMute,
+        ERadioEventAudioMode,
+        ERadioEventAntenna,
+        ERadioEventAudioRouting,
+        ERadioEventSeeking,
+        ERadioEventRegion,
+        ERadioEventFmTransmitter
+        };
+
+    /**
+     * Possible radio scan events.
+     */
+    enum TRadioScanEvent
+        {
+        /**
+         * Scanning found a valid frequency.
+         */
+        ERadioEventFrequencyScanned,
+
+        /**
+         * Scanning is completed.
+         */
+        ERadioEventScanCompleted
+
+        };
+
+    enum TRadioInitialisationState
+        {
+        ERadioNotInitialized,
+        ERadioUtilitiesConstructed,
+        ERadioTunerControlGranted
+        };
+
+    void ConstructL();
+
+    /**
+     * Switches power on/off after a delay
+     *
+     * @param aPowerOn ETrue if power is to be switched on,
+     *                 EFalse if power is to be switched off
+     */
+    void SwitchPower( TBool aPowerOn );
+
+    /**
+     * Callback for switching the radio power on
+     *
+     * @param aSelfPtr A pointer to CRadioEngineImp instance
+     * @return KErrNone
+     */
+    static TInt StaticPowerOnCallback( TAny* aSelfPtr );
+
+    /**
+     * Callback for switching the radio power off
+     *
+     * @param aSelfPtr A pointer to CRadioEngineImp instance
+     * @return KErrNone
+     */
+    static TInt StaticPowerOffCallback( TAny* aSelfPtr );
+
+    /**
+     * Switches radio power ON.
+     */
+    void PowerOn();
+
+    /**
+     * Switches radio power OFF.
+     */
+    void PowerOff();
+
+    /**
+     * Converts region code used internally by Visual Radio
+     * in to a frequency range by tuner ( TFmRadioFrequencyRange )
+     *
+     * @param aRegionId VR region ID
+     * @return Frequency range
+     */
+    TFmRadioFrequencyRange TunerFrequencyRangeForRegionId( TInt aRegionId ) const;
+
+    /**
+     * Non-leaving version of DoNotifyRadioEventL.
+     * @param aRadioEvent event notification ( identification )
+     * @param aErrorCode error code related to state change
+     */
+    void NotifyRadioEvent( TInt aRadioEvent, TInt aErrorCode = KErrNone );
+
+    /**
+     * Leaving version of DoNotifyRadioEvent.
+     * @param aRadioEvent event notification ( identification )
+     * @param aErrorCode error code related to state change
+     */
+    void DoNotifyRadioEventL( TInt aRadioEvent, TInt aErrorCode = KErrNone );
+
+    /**
+     * Notifies the observer of a radio scan event.
+     *
+     * @param   aEvent      Event to notify.
+     * @param   aObserver   Scan observer.
+     * @param   aError      Error code the event completed with.
+     */
+    void NotifyRadioScanEvent( TRadioScanEvent aEvent, MRadioScanObserver& aObserver,
+                               TInt aError = KErrNone );
+
+    /**
+     * Notifies the observer of a radio scan event.
+     *
+     * @param   aEvent      Event to notify.
+     * @param   aObserver   Scan observer.
+     * @param   aError      Error code the event completed with.
+     */
+    void DoNotifyRadioScanEventL( TRadioScanEvent aEvent, MRadioScanObserver& aObserver,
+                                  TInt aError );
+
+    /**
+     * Handles the change in audio routing
+     *
+     * @param aDestination The new routing destination
+     */
+    void HandleAudioRoutingEvent( RadioEngine::TRadioAudioRoute aDestination );
+
+    /**
+     * Handles the change in power state
+     *
+     * @param aPowerOn The power state
+     * @param aErrorCode Error code related to state change
+     */
+    void HandlePowerEvent( TBool aPowerOn, TInt aErrorCode = KErrNone );
+
+    /**
+     * Handles the change in power state
+     *
+     * @param aFrequency The current frequency
+     * @param aErrorCode Error code related to state change
+     */
+    void HandleFrequencyEvent( TUint32 aFrequency, TInt aErrorCode = KErrNone );
+
+    /**
+     * Converts the volume used by Visual Radio to volume used by Radio Utility
+     *
+     * @param aUiVolume The Volume used by Visual Radio
+     * @return The volume used by Radio Utility
+     */
+    TInt TunerVolumeForUiVolume( TInt aUiVolume );
+
+// from base class MRadioSystemEventObserver
+
+    void HandleSystemEventL( TRadioSystemEventType aEventType );
+
+// from base class MRadioFmTunerObserver
+
+    void MrftoRequestTunerControlComplete( TInt aError );
+    void MrftoSetFrequencyRangeComplete( TInt aError );
+    void MrftoSetFrequencyComplete( TInt aError );
+    void MrftoStationSeekComplete( TInt aError, TInt aFrequency );
+    void MrftoFmTransmitterStatusChange( TBool aActive );
+    void MrftoAntennaStatusChange( TBool aAttached );
+    void MrftoOfflineModeStatusChange( TBool aOfflineMode );
+    void MrftoFrequencyRangeChange( TFmRadioFrequencyRange aBand );
+    void MrftoFrequencyChange( TInt aNewFrequency );
+    void MrftoForcedMonoChange( TBool aForcedMono );
+    void MrftoSquelchChange( TBool aSquelch );
+
+// from base class MRadioPlayerObserver
+
+    void MrpoStateChange( TPlayerState aState, TInt aError );
+    void MrpoVolumeChange( TInt aVolume );
+    void MrpoMuteChange( TBool aMute );
+    void MrpoBalanceChange( TInt aLeftPercentage, TInt aRightPercentage );
+
+// from base class MRadioSettingsObserver
+
+    void RdsAfSearchSettingChangedL( TBool aEnabled );
+    void RegionSettingChangedL( TInt aRegion );
+
+// from base class MRadioRdsDataObserver
+
+    void RdsAvailable( TUint32 /*aFrequency*/, TBool /*aAvailable*/ ) {}
+    void RdsAfSearchBegin();
+    void RdsAfSearchEnd( TUint32 aFrequency, TInt aError );
+    void RdsAfSearchStateChange( TBool /*aEnabled*/ ) {}
+    void RdsDataProgrammeService( TUint32 /*aFrequency*/, const TDesC& /*aProgramService*/ ) {}
+    void RdsDataRadioText( TUint32 /*aFrequency*/, const TDesC& /*aRadioText*/ ) {}
+    void RdsDataRadioTextPlus( TUint32 /*aFrequency*/, const TInt /*aRadioTextPlusClass*/, const TDesC& /*aRadioText*/ ) {}
+    void RdsDataGenre( TUint32 /*aFrequency*/, const TInt /*aGenre*/ ) {}
+    void RdsDataPiCode( TUint32 /*aFrequency*/, const TInt /*aPiCode*/ ) {}
+
+// New functions
+
+    /**
+     * Tries to figure the region out based on current mobile network id
+     */
+    TRadioRegion RegionFromMobileNetwork() const;
+
+    /**
+     * Tries to figure the region out based on timezone selection
+     */
+    TRadioRegion RegionFromTimezone() const;
+
+    /**
+     * Performs the timezone-based check
+     */
+    TRadioRegion DoRegionFromTimezoneL() const;
+
+private: // data
+
+    /**
+     * Array of state change observers.
+     */
+    RPointerArray<MRadioEngineObserver>         iObservers;
+
+    /**
+     * A pointer to system event collector
+     * Own.
+     */
+    CRadioSystemEventCollector*                 iSystemEventCollector;
+
+    /**
+     * Radio settings
+     * Own.
+     */
+    CRadioSettings*                             iSettings;
+
+    /**
+     * Network info listener
+     * Own.
+     */
+    CRadioNetworkInfoListener*                  iNetworkInfoListener;
+
+    /**
+     * Controls the radio hardware
+     */
+    CRadioUtility*                              iRadioUtility;
+
+    /**
+     * Controls FM radio tuner. Not owned.
+     */
+    CRadioFmTunerUtility*                       iTunerUtility;
+
+    /**
+     * Controls the radio player. Not owned.
+     */
+    CRadioPlayerUtility*                        iPlayerUtility;
+
+    /**
+     * Receives and notifies of the RDS data
+     */
+    CRadioRdsReceiverBase*                      iRdsReceiver;
+
+    /**
+     * State for radio initialization
+     */
+    TRadioInitialisationState                   iRadioInitializationState;
+
+    /**
+     * Radio on/off timer.
+     */
+    CPeriodic*                                  iRadioTimer;
+
+    /**
+    * If this is true, audio resource availability is ignored on next radio power on
+    */
+    TBool                                       iOverrideAudioResources;
+
+    /**
+     * Direction of the previous seek request, needed for canceling
+     */
+    RadioEngine::TRadioSeeking                  iSeekingState;
+
+    /**
+     * Antenna state.
+     */
+    TBool                                       iAntennaAttached;
+
+    /**
+     * Radio enabling state
+     */
+    TBool                                       iRadioEnabled;
+
+    /**
+     * ETrue if frequency was set by RDS AF
+     */
+    TBool                                       iFrequencySetByRdsAf;
+
+    /**
+     * The state of the fm transmitter
+     */
+    TBool                                       iFmTransmitterActive;
+
+    /**
+     * Cause for the ongoing frequency change operation.
+     */
+    RadioEngine::TRadioFrequencyEventReason     iFreqEventReason;
+
+    /**
+     * Publish&Subscribe object. Can be NULL.
+     * Owned if set
+     */
+    CRadioPubSub*                               iPubSub;
+
+    /**
+     * Radio scan observer. NULL when scanning is not ongoing
+     * Not owned.
+     */
+    MRadioScanObserver*                         iScanObserver;
+
+    /**
+     * The previously scanned frequency, or <code>KErrNotFound</code> if none.
+     */
+    TUint32                                     iPreviousScannedFrequency;
+
+    /**
+     * The state of mute before scan has been started.
+     */
+    TBool                                       iPreviousMuteState;
+
+    };
+
+#endif  // CRADIOENGINEIMP_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/engine/inc/cradionetworkinfolistener.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,109 @@
+/*
+* 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 C_RADIONETWORKINFOLISTENER_H
+#define C_RADIONETWORKINFOLISTENER_H
+
+// System includes
+#include <e32base.h>
+#include <etel3rdparty.h>
+
+// Forward declarations
+class CTelephony;
+class MRadioSettingsSetter;
+
+/**
+ * An interface for notifying about network id changes
+ */
+NONSHARABLE_CLASS( MRadioNetworkChangeObserver )
+    {
+public:
+
+    /**
+     * Used for notifying that the network id has changed
+     */
+    virtual void NetworkIdChanged() = 0;
+
+    };
+
+/**
+ * Listens changes in network ID and country code.
+ */
+NONSHARABLE_CLASS( CRadioNetworkInfoListener ) : public CActive
+    {
+public:
+
+    static CRadioNetworkInfoListener* NewL( MRadioSettingsSetter& aSetter,
+                                            MRadioNetworkChangeObserver* aObserver );
+
+    ~CRadioNetworkInfoListener();
+
+    /**
+     * Return current combined network ID and country code as TInt.
+     * @return   An integer composed of the current network ID and country code.
+     */
+    TInt CompoundNetworkId() const;
+
+    /**
+     * Returns current country code.
+     * @return   The current country code.
+     */
+    TPtrC CountryCode() const;
+
+    /**
+     * SubscriberId
+     * @return subscriber id
+     */
+    TPtrC SubscriberId() const;
+
+private:
+
+    CRadioNetworkInfoListener( MRadioSettingsSetter& aSetter,
+                               MRadioNetworkChangeObserver* aObserver );
+
+    void ConstructL();
+
+// from base class CActive
+
+    void DoCancel();
+    void RunL();
+
+// New functions
+
+    void SaveNetworkInfoL();
+
+private: // data
+
+    MRadioSettingsSetter&           iSetter;
+
+    MRadioNetworkChangeObserver*    iObserver;
+
+#ifndef __WINS__
+    CTelephony*                     iTelephony;
+#endif
+
+    CTelephony::TSubscriberIdV1     iSubscriberId;
+    CTelephony::TSubscriberIdV1Pckg iSubscriberIdPckg;
+    CTelephony::TNetworkInfoV1      iNetworkInfo;
+    CTelephony::TNetworkInfoV1Pckg  iNetworkInfoPckg;
+
+    TInt                            iCompoundNetworkId;
+    TInt                            iPreviousCompoundNetworkId;
+
+    };
+
+#endif // C_RADIONETWORKINFOLISTENER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/engine/inc/cradiordsreceiver.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef CRADIORDSRECEIVER_H
+#define CRADIORDSRECEIVER_H
+
+// User includes
+#include "cradiordsreceiverbase.h"
+
+// Forward declarations
+class MRadioEngineSettings;
+
+// Class declaration
+NONSHARABLE_CLASS( CRadioRdsReceiver ) : public CRadioRdsReceiverBase
+    {
+public:
+
+    static CRadioRdsReceiver* NewL( MRadioEngineSettings& aSettings );
+
+    virtual ~CRadioRdsReceiver();
+
+private:
+
+    CRadioRdsReceiver( MRadioEngineSettings& aSettings );
+
+    void ConstructL();
+
+// from base class MRadioRdsReceiver
+
+    void InitL( CRadioUtility& aRadioUtility, CRadioPubSub* aPubSub );
+    void SetAutomaticSwitchingL( TBool aEnable );
+    void StartReceiver();
+    void StopReceiver();
+
+// New functions
+
+    /**
+     * Logs the RDS receiver capabilities if logging is enabled
+     */
+    void LogReceiverCapabilities();
+
+private: // data
+
+    /** The RDS utility */
+    CRadioRdsUtility*   iRdsUtility;
+
+    /** State of the RDS receiver */
+    TBool               iStarted;
+
+    };
+
+#endif // CRADIORDSRECEIVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/engine/inc/cradiordsreceiverbase.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,172 @@
+/*
+* 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 CRADIORDSRECEIVERBASE_H
+#define CRADIORDSRECEIVERBASE_H
+
+// System includes
+#include <RadioRdsUtility.h>
+
+// User includes
+#include "mradioenginesettings.h"
+#include "mradiordsdataobserver.h"
+#include "mradiordsreceiver.h"
+
+// Forward declarations
+class CRadioUtility;
+class CRadioPubSub;
+
+// Class declaration
+NONSHARABLE_CLASS( CRadioRdsReceiverBase ) : public CBase
+                                           , public MRadioRdsReceiver
+                                           , public MRadioRdsObserver
+    {
+public:
+
+    /**
+     * The destructor
+     */
+    virtual ~CRadioRdsReceiverBase();
+
+    /**
+     * Adds an observer wich will be notified of the new RDS data
+     * If observer already exists, it is not added
+     *
+     * @param aObserver pointer of the observer instance.
+     */
+    void AddObserverL( MRadioRdsDataObserver* aObserver );
+
+    /**
+     * Removes the rds observer.
+     */
+    void RemoveObserver( MRadioRdsDataObserver* aObserver );
+
+    /**
+     * Getter for automatic switching state of alternate frequencies
+     *
+     * @return ETrue if automatic switching is enabled
+     */
+    TBool AutomaticSwitchingEnabled() const;
+
+    /**
+     * Getter for the programme service name
+     *
+     * @return Programme service name
+     */
+    const TDesC& ProgrammeService() const;
+
+    /**
+     * Getter for the radio text.
+     *
+     * @return Radio text.
+     */
+    const TDesC& RadioText() const;
+
+    /**
+     * Getter for the RDS signal availability
+     *
+     * @return ETrue if RDS signal is available, otherwise EFalse
+     */
+    TBool SignalAvailable() const;
+
+    /**
+     * Setter for automatic switching of alternate frequencies
+     * If this method is overridden, the base implementation should be called
+     *
+     * @param aEnable ETrue, if automatic swithing is to be enabled
+     */
+    virtual void SetAutomaticSwitchingL( TBool aEnable );
+
+    /**
+     * Clears the RDS information
+     */
+    void ClearRdsInformation();
+
+protected:
+
+    CRadioRdsReceiverBase( MRadioEngineSettings& aSettings );
+
+    void BaseConstructL();
+
+// from base class MRadioRdsObserver
+
+    void MrroStationSeekByPTYComplete( TInt aError, TInt aFrequency );
+    void MrroStationSeekByTAComplete( TInt aError, TInt aFrequency );
+    void MrroStationSeekByTPComplete( TInt aError, TInt aFrequency );
+    void MrroGetFreqByPTYComplete( TInt aError, RArray<TInt>& aFreqList );
+    void MrroGetFreqByTAComplete( TInt aError, RArray<TInt>& aFreqList );
+    void MrroGetPSByPTYComplete( TInt aError, RArray<TRdsPSName>& aPsList );
+    void MrroGetPSByTAComplete( TInt aError, RArray<TRdsPSName>& aPsList );
+    void MrroRdsDataPI( TInt aPi );
+    void MrroRdsDataPTY( TRdsProgrammeType aPty );
+    void MrroRdsDataPS( TRdsPSName& aPs );
+    void MrroRdsDataRT( TRdsRadioText& aRt );
+    void MrroRdsDataCT( TDateTime& aCt );
+    void MrroRdsDataTA( TBool aTaOn );
+    void MrroRdsDataRTplus( TRdsRTplusClass aRtPlusClass, TRdsRadioText& aRtPlusData );
+    void MrroRdsSearchBeginAF();
+    void MrroRdsSearchEndAF( TInt aError, TInt aFrequency );
+    void MrroRdsStationChangeTA( TInt aFrequency );
+    void MrroRdsEventAutomaticSwitchingChange( TBool aAuto );
+    void MrroRdsEventAutomaticTrafficAnnouncement( TBool aAuto );
+    void MrroRdsEventSignalChange( TBool aSignal );
+
+protected: // data
+
+    /**
+     * The radio settings
+     */
+    MRadioEngineSettings&               iSettings;
+
+    /**
+     * Publish&Subscribe object. Can be NULL.
+     * Not own.
+     */
+    CRadioPubSub*                       iPubSub;
+
+private: // data
+
+    /**
+     * Array of RDS observers.
+     */
+    RPointerArray<MRadioRdsDataObserver> iObservers;
+
+    /**
+     * The programme service name cache.
+     * Own.
+     */
+    HBufC*                              iPsName;
+
+    /**
+     * The RDS radio text
+     * Own.
+     */
+    RBuf                                iRadioText;
+
+    /**
+     * ETrue if the RDS signal is available
+     */
+    TBool                               iSignalAvailable;
+
+    /**
+     * ETrue if AF is enabled
+     */
+    TBool                               iAfEnabled;
+
+    };
+
+#endif // CRADIORDSRECEIVERBASE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/engine/inc/t_cradiordsreceiversimulator.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,100 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef T_CRADIORDSRECEIVERSIMULATOR_H
+#define T_CRADIORDSRECEIVERSIMULATOR_H
+
+// User includes
+#include "mradiordsdataobserver.h"
+#include "cradiordsreceiverbase.h"
+
+// Class declaration
+NONSHARABLE_CLASS( CRadioRdsReceiverSimulator ) : public CRadioRdsReceiverBase
+    {
+public:
+
+    static CRadioRdsReceiverSimulator* NewL( MRadioEngineSettings& aSettings );
+
+    virtual ~CRadioRdsReceiverSimulator();
+
+// from base class MRadioRdsReceiver
+
+    void InitL( CRadioUtility& aRadioUtility, CRadioPubSub* aPubSub );
+    void StartReceiver();
+    void StopReceiver();
+
+private:
+
+    /** The simulated events */
+    enum TRadioRdsSimulationEvent
+        {
+        ERadioRdsEventSignalOn,
+        ERadioRdsEventSignalOff,
+        ERadioRdsEventPS,
+        ERadioRdsEventAFBegin,
+        ERadioRdsEventAFEnd,
+        ERadioRdsEventRadioText,
+        ERadioRdsEventRadioTextPlus
+        };
+
+    CRadioRdsReceiverSimulator( MRadioEngineSettings& aSettings );
+
+    void ConstructL();
+
+    void ParseRdsDataL();
+
+    void startRTPlusTimer();
+	
+    /**
+     * StaticRdsSimulationCallback Callback for RDS simulation
+     */
+    static TInt StaticRdsSimulationCallback( TAny* aSelfPtr );
+	
+    /**
+     * Callback for RT+ simulation
+     */
+    static TInt StaticRdsSimulationCallback2( TAny* aSelfPtr );
+    
+private: // data
+
+    /** Timer for RDS event simulation */
+    CPeriodic* iEventSimulatorTimer;
+    
+    /** Timer for RT+ events */
+    CPeriodic* iEventSimulatorTimer2;
+
+    /** The iterator for RDS events */
+    TInt iEventIterator;
+
+    /** The iterator for RT+ events */
+    TInt iRtPlusIterator;
+    
+    /** The iterator for RT events */
+    TInt iRtIterator;
+    
+    /** The iterator for PS names */
+    TInt iPsIterator;
+
+    /** The iterator for frequencies */
+    TInt iFrequencyIterator;
+
+    /** The iterator for RT and RT+ information */
+    TInt iRadioTextIterator;
+
+    };
+
+#endif // T_CRADIORDSRECEIVERSIMULATOR_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/engine/src/cradioengine.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// User includes
+#include "cradioengine.h"
+#include "cradioengineimp.h"
+#include "cradioenginelogger.h"
+#include "mradioengineinitializer.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------------------------
+// Starts the radio engine initialization.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CRadioEngine* CRadioEngine::NewL( MRadioEngineInitializer& aInitializer )
+    {
+    CRadioAudioRouter* audioRouter = aInitializer.InitAudioRouterL();
+    CleanupStack::PushL( audioRouter );
+
+    CRadioEngineImp* self = new (ELeave) CRadioEngineImp( audioRouter );
+    CleanupStack::Pop( audioRouter );
+    CleanupStack::PushL( self );
+
+    self->SetSystemEventCollector( aInitializer.InitSystemEventCollectorL() );
+    self->SetRadioSettings( aInitializer.InitSettingsL() );
+    self->SetRadioPubSub( aInitializer.InitPubSubL() );
+    self->ConstructL();
+
+    self->InitRadioL( self->DetermineRegion(), self->PubSub() );
+    self->EnableAudio( ETrue );
+
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioEngine::CRadioEngine( CRadioAudioRouter* aAudioRouter )
+    : CRadioRoutableAudio( aAudioRouter )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CRadioEngine::~CRadioEngine()
+    {
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/engine/src/cradioengineimp.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,1873 @@
+/*
+* 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:
+*
+*/
+
+// System includes
+#include <AudioOutput.h>
+#include <eikdef.h>
+#include <coemain.h>
+#include <badesca.h>
+#include <tzlocalizer.h>
+
+// User includes
+#include "cradioenginelogger.h"
+#include "radiointernalpskeys.h"
+#include "radiointernalcrkeys.h"
+#include "cradioaudiorouter.h"
+#include "cradiopubsub.h"
+#include "cradioengineimp.h"
+#include "mradioengineobserver.h"
+#include "mradioscanobserver.h"
+#include "cradioregion.h"
+#include "cradiosettings.h"
+#include "mradioenginesettings.h"
+#include "mradiosettingssetter.h"
+#include "cradiorepositorymanager.h"
+#include "cradiordsreceiver.h"
+#include "cradiosystemeventcollector.h"
+#include "cradionetworkinfolistener.h"
+#include "radioengine.hrh"
+
+#include "../../group/buildflags.hrh"
+#ifdef __FEATURE_RDS_SIMULATOR
+#   include "t_cradiordsreceiversimulator.h"
+#endif
+
+// Constants
+
+/** The limit of volume steps that must not be divided */
+const TInt KRadioVolumeStepsDividinglimit = 20;
+/** If CMMTunerUtility has 200 volume steps, AknVolume control has 20 steps */
+const TInt KRadioVolumeStepsDivider = 500;
+/** amount of volume steps used previously */
+#if defined __WINS__
+const TInt KRadioVolumeStepsOld = 10;
+#endif // defined __WINS__
+
+/** KRadioRadioSwitchDelay value must not be too small, otherwise problems with
+ radioserver will occur, when swithing between valid and invalid presets */
+const TInt KRadioRadioSwitchDelay = 300; // In milliseconds
+
+const TInt KRadioThousand = 1000;
+const TInt KRadioMillion = KRadioThousand * KRadioThousand;
+
+// Country order from timezones.rss. Default = 0, Japan = 1, America = 2.
+const TUint KCityGroupRegions[] =
+    {0,0,0,0,0,0,2,0,0,0,0,2,0,2,0,2,0,2,0,2,2,0,2,0,0,2,2,2,0,2,0,0, //32
+     0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,2,1,0,0,0,0,0,0,0,0,0,0,0, //64
+     0,0,0,0,0,2,0,0,0,2,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //96
+     0,0,0,2,0,0,0,0,2,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //128
+     0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //160
+     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0, //192
+     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0, //224
+     2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioEngineImp::CRadioEngineImp( CRadioAudioRouter* aAudioRouter )
+    : CRadioEngine( aAudioRouter )
+    , iAntennaAttached( ETrue )
+    , iFreqEventReason( RadioEngine::ERadioFrequencyEventReasonUnknown )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::ConstructL()
+    {
+    LOG_METHOD_AUTO;
+
+    if ( !iAudioRouter || !iSystemEventCollector || !iSettings )
+        {
+        User::Leave( KErrNotReady );
+        }
+
+    iSystemEventCollector->AddObserverL( this );
+
+    // Initial default values to be over by init
+    User::LeaveIfError( iSettings->RadioSetter().SetPowerOn( EFalse ) );
+
+    // The output source needs to be in headset when starting the radio.
+    // But if the headset is not connected, audio cannot be heard if it is routed
+    // to headset
+    RadioEngine::TRadioAudioRoute route = iSystemEventCollector->IsHeadsetConnectedL() ?
+                                RadioEngine::ERadioHeadset : RadioEngine::ERadioSpeaker;
+    User::LeaveIfError( iSettings->RadioSetter().SetAudioRoute( route ) );
+
+#ifdef __FEATURE_RDS_SIMULATOR
+    iRdsReceiver = CRadioRdsReceiverSimulator::NewL( iSettings->EngineSettings() );
+#else
+    iRdsReceiver = CRadioRdsReceiver::NewL( iSettings->EngineSettings() );
+#endif
+
+    iNetworkInfoListener = CRadioNetworkInfoListener::NewL( iSettings->RadioSetter(), NULL );
+
+    iRdsReceiver->AddObserverL( this );
+
+    // Create timer that is used when polling for radio restart.
+    iRadioTimer = CPeriodic::NewL( CActive::EPriorityHigh );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioEngineImp::~CRadioEngineImp()
+    {
+    LOG( "CRadioEngineImp::~CRadioEngineImp -- Start" );
+
+    delete iNetworkInfoListener;
+
+    PowerOff();
+
+    delete iRadioTimer;
+
+    DeleteAudioOutput();
+
+    if ( iTunerUtility )
+        {
+        iTunerUtility->Close();
+        }
+
+    if ( iPlayerUtility )
+        {
+        iPlayerUtility->Close();
+        }
+
+    if ( iRdsReceiver )
+        {
+        iRdsReceiver->RemoveObserver( this );
+        }
+
+    delete iRdsReceiver;
+    delete iRadioUtility;
+
+    iObservers.Close();
+
+    if ( iSystemEventCollector )
+        {
+        iSystemEventCollector->RemoveObserver( this );
+        }
+    delete iSystemEventCollector;
+
+    delete iPubSub;
+
+    if ( iSettings )
+        {
+        iSettings->RadioSetter().SetObserver( NULL );
+        }
+    delete iSettings;
+
+    LOG( "CRadioEngineImp::~CRadioEngineImp -- End" );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::SetSystemEventCollector( CRadioSystemEventCollector* aCollector )
+    {
+    iSystemEventCollector = aCollector;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::SetRadioSettings( CRadioSettings* aSettings )
+    {
+    iSettings = aSettings;
+    iSettings->RadioSetter().SetObserver( this );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::SetRadioPubSub( CRadioPubSub* aPubSub )
+    {
+    iPubSub = aPubSub;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioAudioRouter& CRadioEngineImp::AudioRouter() const
+    {
+    return *iAudioRouter;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioSystemEventCollector& CRadioEngineImp::SystemEventCollector() const
+    {
+    return *iSystemEventCollector;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioSettings& CRadioEngineImp::Settings() const
+    {
+    return *iSettings;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioPubSub* CRadioEngineImp::PubSub() const
+    {
+    return iPubSub;
+    }
+
+// ---------------------------------------------------------------------------
+// Determines radio region
+// ---------------------------------------------------------------------------
+//
+TRadioRegion CRadioEngineImp::DetermineRegion()
+    {
+    TRadioRegion region = ERadioRegionNone;
+
+    MRadioEngineSettings& engineSettings = iSettings->EngineSettings();
+    if ( iSystemEventCollector->IsMobileNetworkCoverage() )
+        {
+        region = RegionFromMobileNetwork();
+        }
+    else
+        {
+        region = RegionFromTimezone();
+        }
+
+    if ( !iSettings->IsRegionAllowed( region ) )
+        {
+        region = ERadioRegionNone;
+        }
+
+    // Region not found, try to use the previously set region
+    if ( region == ERadioRegionNone && engineSettings.RegionId() != ERadioRegionNone )
+        {
+        region = engineSettings.RegionId();
+        }
+
+    // All regions have been searched and no direct match found, use default one
+    if ( region == ERadioRegionNone )
+        {
+        region = engineSettings.DefaultRegion();
+        }
+
+    return region;
+    }
+
+// ---------------------------------------------------------------------------
+// Initializes / reinitializes the radio. If this is not called
+// the radio is not functional
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::InitRadioL( TInt aRegionId, CRadioPubSub* aPubSub )
+    {
+    LOG_METHOD_AUTO;
+    LOG_FORMAT( "CRadioEngineImp::InitRadioL: Region: %d", aRegionId );
+
+    iRadioInitializationState = ERadioNotInitialized;
+
+    iPubSub = aPubSub;
+
+    iFreqEventReason = RadioEngine::ERadioFrequencyEventReasonUnknown;
+    if ( iSettings->EngineSettings().RegionId() != aRegionId )
+        {
+        // Change only when necessary as it changes also the default tuned frequency
+        User::LeaveIfError( iSettings->RadioSetter().SetRegionId( aRegionId ) );
+        }
+
+    if ( !iRadioUtility )
+        {
+        iRadioUtility = CRadioUtility::NewL( ETrue );
+        }
+
+    if ( !iPlayerUtility )
+        {
+        iPlayerUtility = &iRadioUtility->RadioPlayerUtilityL( *this );
+        SetAudioOutput( CAudioOutput::NewL( *iPlayerUtility ) );
+        }
+
+    if ( !iTunerUtility )
+        {
+        iTunerUtility = &iRadioUtility->RadioFmTunerUtilityL( *this );
+        }
+
+    // Utilities have been created now
+    iRadioInitializationState = ERadioUtilitiesConstructed;
+
+    // Before first RequestTunerControl() call it is ok to enable offline mode without checking capabilities
+    iTunerUtility->EnableTunerInOfflineMode( ETrue );
+    iTunerUtility->RequestTunerControl();
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioEngineImp::RadioInitialized() const
+    {
+    return iRadioInitializationState == ERadioTunerControlGranted;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the state for radio audio
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::EnableAudio( TBool aEnable, TBool aDelay )
+    {
+    LOG_FORMAT( "CRadioEngineImp::EnableAudio( %d )", aEnable );
+    iRadioEnabled = aEnable;
+    if ( aDelay )
+        {
+        SwitchPower( iRadioEnabled );
+        }
+    else if ( aEnable )
+        {
+        if ( !RadioInitialized() &&
+             iRadioInitializationState == ERadioUtilitiesConstructed &&
+             iRadioEnabled &&
+             OkToPlay( iSettings->EngineSettings().TunedFrequency() ) )
+            {
+            iTunerUtility->RequestTunerControl();
+            }
+        else
+            {
+            PowerOn();
+            }
+        }
+    else
+        {
+        PowerOff();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Gets the state for radio audio.
+// ---------------------------------------------------------------------------
+//
+TBool CRadioEngineImp::RadioAudioEnabled() const
+    {
+    return iRadioEnabled;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the state for audio overriding
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::SetAudioOverride( TBool aOverride )
+    {
+    LOG_FORMAT( "CRadioEngineImp::SetAudioOverride( %d )", aOverride );
+    iOverrideAudioResources = aOverride;
+    }
+
+// ---------------------------------------------------------------------------
+// Adds an observer for the radio state changes notifications.
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::AddObserverL( MRadioEngineObserver* aObserver )
+    {
+    LOG( "CRadioEngineImp::AddObserver" );
+    TInt index = iObservers.FindInAddressOrder( aObserver );
+    if ( index == KErrNotFound )
+        {
+        iObservers.InsertInAddressOrderL( aObserver );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Removes an observer from the list of obsevers
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::RemoveObserver( MRadioEngineObserver* aObserver )
+    {
+    LOG( "CRadioEngineImp::RemoveObserver" );
+    TInt index = iObservers.FindInAddressOrder( aObserver );
+
+    if ( index >= 0 )
+        {
+        iObservers.Remove( index );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TFmRadioFrequencyRange CRadioEngineImp::TunerFrequencyRangeForRegionId( TInt aRegionId ) const
+    {
+    TFmRadioFrequencyRange result = EFmRangeEuroAmerica;
+    switch ( aRegionId )
+        {
+        case ERadioRegionDefault:
+            {
+            result = EFmRangeEuroAmerica;
+            break;
+            }
+        case ERadioRegionJapan:
+            {
+            result = EFmRangeJapan;
+            break;
+            }
+        case ERadioRegionAmerica:
+            {
+            result = EFmRangeEuroAmerica;
+            break;
+            }
+        default:
+            break;
+        }
+    return result;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets radio mode ERadioStereo or ERadioMono
+// ---------------------------------------------------------------------------
+
+void CRadioEngineImp::SetAudioMode( TInt aAudioMode )
+    {
+    LOG_FORMAT( "CRadioEngineImp::SetAudioMode: aAudioMode: %d", aAudioMode );
+    TInt err = KErrNone;
+    if ( !RadioInitialized() )
+        {
+        TInt err = iSettings->RadioSetter().SetOutputMode( aAudioMode );
+        NotifyRadioEvent( ERadioEventAudioMode, err );
+        }
+    else
+        {
+        err = iTunerUtility->ForceMonoReception( aAudioMode == RadioEngine::ERadioMono );
+
+        if ( err )
+            {
+            NotifyRadioEvent( ERadioEventAudioMode, err );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Switches power on/off after a delay
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::SwitchPower( TBool aPowerOn )
+    {
+    LOG_FORMAT( "CRadioEngineImp::SwitchPower( %d )", aPowerOn );
+    if ( RadioInitialized() )
+        {
+        if ( !aPowerOn || OkToPlay( iSettings->EngineSettings().TunedFrequency() ) )
+            {
+            iRadioTimer->Cancel();
+            if ( aPowerOn )
+                {
+                iRadioTimer->Start( TTimeIntervalMicroSeconds32( KRadioRadioSwitchDelay * KRadioThousand ),
+                        TTimeIntervalMicroSeconds32( 0 ),
+                        TCallBack( StaticPowerOnCallback, this ) );
+                }
+            else
+                {
+                iRadioTimer->Start( TTimeIntervalMicroSeconds32( KRadioRadioSwitchDelay * KRadioThousand ),
+                        TTimeIntervalMicroSeconds32( 0 ),
+                        TCallBack( StaticPowerOffCallback, this ) );
+                }
+            }
+        }
+    else if ( aPowerOn &&
+            iRadioInitializationState == ERadioUtilitiesConstructed &&
+            iRadioEnabled &&
+            OkToPlay( iSettings->EngineSettings().TunedFrequency() ) )
+        {
+        iTunerUtility->RequestTunerControl();
+        }
+    else
+        {
+        LOG( "CRadioEngineImp::SwitchPower - Unhandled case" );
+        LOG_FORMAT( "PowerOn: %d, InitializationState: %d, Enabled: %d, Frequency: %d",
+                aPowerOn, iRadioInitializationState, iRadioEnabled, iSettings->EngineSettings().TunedFrequency() );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Executes the power switch
+// ---------------------------------------------------------------------------
+//
+TInt CRadioEngineImp::StaticPowerOnCallback( TAny* aSelfPtr )
+    {
+    LOG( "CRadioEngineImp::StaticPowerOnCallback" );
+    CRadioEngineImp* self = reinterpret_cast<CRadioEngineImp*>( aSelfPtr );
+
+    if ( self )
+        {
+        self->iRadioTimer->Cancel(); // prevents the further calls.
+
+        if ( !self->iSettings->EngineSettings().IsPowerOn() )
+            {
+            self->PowerOn();
+            }
+        }
+
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// Executes the power switch
+// ---------------------------------------------------------------------------
+//
+TInt CRadioEngineImp::StaticPowerOffCallback( TAny* aSelfPtr )
+    {
+    LOG( "CRadioEngineImp::StaticPowerOffCallback" );
+    CRadioEngineImp* self = reinterpret_cast<CRadioEngineImp*>( aSelfPtr );
+
+    if ( self )
+        {
+        self->iRadioTimer->Cancel(); // prevents the further calls.
+
+        if ( self->iSettings->EngineSettings().IsPowerOn() )
+            {
+            self->PowerOff();
+            }
+        }
+
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::PowerOn()
+    {
+    LOG_METHOD_AUTO;
+
+    if ( RadioInitialized() &&
+        iRadioEnabled &&
+        OkToPlay( iSettings->EngineSettings().TunedFrequency() ) )
+        {
+        SetAudioMode( iSettings->EngineSettings().OutputMode() );
+        iPlayerUtility->SetVolumeRamp( TTimeIntervalMicroSeconds( MAKE_TINT64( 0, KRadioMillion ) ) );
+        iPlayerUtility->SetVolume( TunerVolumeForUiVolume( iSettings->EngineSettings().Volume() ) );
+
+        // If we are about to start scanning, mute the radio and set minimum frequency
+        if ( iScanObserver )
+            {
+            iPlayerUtility->Mute( ETrue );
+            iTunerUtility->SetFrequency( iSettings->EngineSettings().MinFrequency() );
+            }
+        else
+            {
+            iPlayerUtility->Mute( iSettings->EngineSettings().IsVolMuted() );
+            iTunerUtility->SetFrequency( iSettings->EngineSettings().TunedFrequency() );
+            }
+        iFreqEventReason = RadioEngine::ERadioFrequencyEventReasonImplicit;
+
+        TRAP_IGNORE( iAudioRouter->SetAudioRouteL(
+                RadioEngine::TRadioAudioRoute( iSettings->EngineSettings().AudioRoute() ) ) )
+
+        iPlayerUtility->Play();
+        }
+    else
+        {
+        HandlePowerEvent( EFalse, KErrGeneral );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Radio power off
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::PowerOff()
+    {
+    LOG( "CRadioEngineImp::PowerOff" );
+
+    if ( iSettings->EngineSettings().IsPowerOn() )
+        {
+        if ( RadioInitialized() )
+            {
+            iPlayerUtility->Stop();
+            }
+        else // This shouldn't occur normally, just a recovery action
+            {
+            HandlePowerEvent( EFalse, KErrNone );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioEngineImp::OkToPlay( TUint32 aFrequency ) const
+    {
+    TBool audioResourcesAvailable = iSystemEventCollector->IsAudioResourcesAvailable();
+    TBool okToPlay = iAntennaAttached &&
+                     !iFmTransmitterActive &&
+                     ( audioResourcesAvailable || iOverrideAudioResources ) &&
+#ifdef COMPILE_IN_IVALO
+                     IsFrequencyValid( aFrequency )
+                     && !iSystemEventCollector->IsCallActive();
+#else
+                     IsFrequencyValid( aFrequency );
+#endif //COMPILE_IN_IVALO
+
+    LOG_FORMAT( "CRadioEngineImp::OkToPlay, returning %d ", okToPlay );
+    return okToPlay;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioEngineImp::IsFrequencyValid( TUint32 aFrequency ) const
+    {
+    TBool ret( EFalse );
+    if ( !aFrequency )
+        {
+        aFrequency = iSettings->EngineSettings().TunedFrequency();
+        }
+    if ( aFrequency >= iSettings->EngineSettings().MinFrequency() && aFrequency <= iSettings->EngineSettings().MaxFrequency() )
+        {
+        ret = ETrue;
+        }
+    return ret;
+    }
+
+// ---------------------------------------------------------------------------
+// Radio tuning
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::SetFrequency( TUint32 aFrequency, RadioEngine::TRadioFrequencyEventReason aReason )
+    {
+    LOG_METHOD_AUTO;
+    LOG_FORMAT( "CRadioEngineImp::SetFrequency, freq: %u, Initialized: %d, Enabled: %d",
+            aFrequency, RadioInitialized(), iRadioEnabled );
+
+    iFrequencySetByRdsAf = EFalse;
+    iFreqEventReason = aReason;
+
+    TInt frequency = 0;
+    if ( iTunerUtility )
+        {
+        iTunerUtility->GetFrequency( frequency );
+        }
+    CancelSeek();
+
+    if ( aFrequency == frequency ) //radio has already the frequency to be set.
+        {
+        LOG( "CRadioEngineImp::SetFrequency: Already at the requested frequency" );
+        HandleFrequencyEvent( aFrequency );
+        }
+    else
+        {
+        iRadioTimer->Cancel();
+        if ( RadioInitialized() && iRadioEnabled && OkToPlay( aFrequency ) )
+            {
+            LOG( "CRadioEngineImp::SetFrequency: Tuning to frequency" );
+            iTunerUtility->SetFrequency( aFrequency );
+            }
+        else
+            {
+            HandleFrequencyEvent( aFrequency );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Radio tuning
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::SetFrequencyFast( TUint32 aFrequency,
+                                        RadioEngine::TRadioFrequencyEventReason /*aReason*/ )
+{
+    if ( iSeekingState != RadioEngine::ERadioNotSeeking )
+    {
+        iSeekingState = RadioEngine::ERadioNotSeeking;
+        iTunerUtility->CancelStationSeek();
+    }
+    iTunerUtility->SetFrequency( aFrequency );
+    iSettings->RadioSetter().SetTunedFrequency( aFrequency );
+}
+
+// ---------------------------------------------------------------------------
+// Frequency stepping
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::StepToFrequency( RadioEngine::TRadioTuneDirection aDirection )
+    {
+    LOG( "CRadioEngineImp::StepToFrequency" );
+
+    TUint32 freq = iSettings->EngineSettings().TunedFrequency();
+    RadioEngine::TRadioFrequencyEventReason reason( RadioEngine::ERadioFrequencyEventReasonUnknown );
+    if ( aDirection == RadioEngine::ERadioUp )
+        {
+        freq = freq + iSettings->EngineSettings().FrequencyStepSize();
+        reason = RadioEngine::ERadioFrequencyEventReasonUp;
+        }
+    else
+        {
+        freq = freq - iSettings->EngineSettings().FrequencyStepSize();
+        reason = RadioEngine::ERadioFrequencyEventReasonDown;
+        }
+
+    // Check overflow or underflow
+    if ( IsFrequencyValid( freq ) )
+        {
+        if ( aDirection == RadioEngine::ERadioUp )
+            {
+            freq = iSettings->EngineSettings().MinFrequency();
+            }
+        else
+            {
+            freq = iSettings->EngineSettings().MaxFrequency();
+            }
+        }
+    SetFrequency( freq, reason );
+    }
+
+// ---------------------------------------------------------------------------
+// Radio seek
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::Seek( RadioEngine::TRadioTuneDirection aDirection )
+    {
+    LOG_FORMAT( "CRadioEngineImp::Seek-- Start direction:%d",aDirection );
+
+    iFrequencySetByRdsAf = EFalse;
+
+    // Check if audio playing parameters ( other than frequency ) are OK
+    if ( iRadioEnabled &&
+        OkToPlay( iSettings->EngineSettings().MinFrequency() ) &&
+        iSeekingState == RadioEngine::ERadioNotSeeking )
+        {
+        if ( aDirection == RadioEngine::ERadioDown )
+            {
+            iSeekingState = RadioEngine::ERadioSeekingDown;
+            iFreqEventReason = RadioEngine::ERadioFrequencyEventReasonSeekDown;
+            }
+        else
+            {
+            iSeekingState = RadioEngine::ERadioSeekingUp;
+            iFreqEventReason = RadioEngine::ERadioFrequencyEventReasonSeekUp;
+            }
+
+        NotifyRadioEvent( ERadioEventSeeking );
+
+        if ( IsFrequencyValid() )
+            {
+            if ( iSettings->EngineSettings().IsPowerOn() )
+                {
+                iTunerUtility->StationSeek( aDirection == RadioEngine::ERadioUp ? ETrue : EFalse );
+                }
+            else
+                {
+                // Try to switch power on ( reinitialization )
+                SwitchPower( ETrue );
+                }
+            }
+        else
+            {
+            // Tune first to valid frequency, start seeking after radio power is on
+            SetFrequency( iSettings->EngineSettings().MinFrequency(), RadioEngine::ERadioFrequencyEventReasonImplicit );
+            }
+        }
+    else
+        {
+        NotifyRadioEvent( ERadioEventSeeking, KErrGeneral );
+        StopScan( KErrGeneral );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Cancels seek up/down request
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::CancelSeek()
+    {
+    LOG_FORMAT( "CRadioEngineImp::CancelSeek -- seeking state was:%d", iSeekingState );
+
+    if ( !iScanObserver )
+        {
+        if ( iSeekingState != RadioEngine::ERadioNotSeeking )
+            {
+            iSeekingState = RadioEngine::ERadioNotSeeking;
+            iTunerUtility->CancelStationSeek();
+            iFreqEventReason = RadioEngine::ERadioFrequencyEventReasonImplicit;
+            NotifyRadioEvent( ERadioEventSeeking, KErrCancel );
+            NotifyRadioEvent( ERadioEventFrequency, KErrNone ); // Notify the observers even if the frequency remains the same.
+            }
+        }
+    else
+        {
+        StopScan( KErrCancel );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+RadioEngine::TRadioSeeking CRadioEngineImp::Seeking() const
+    {
+    return iSeekingState;
+    }
+
+// ---------------------------------------------------------------------------
+// Starts scanning all available stations from the minimum frequency
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::StartScan( MRadioScanObserver& aObserver )
+    {
+    LOG( "CRadioEngineImp::StartScan" );
+
+    const TUint32 minFrequency = iSettings->EngineSettings().MinFrequency();
+    if ( !iScanObserver && iRadioEnabled && RadioInitialized() && OkToPlay( minFrequency ) )
+        {
+        CancelSeek();
+        iScanObserver = &aObserver;
+        iPreviousMuteState = iSettings->EngineSettings().IsVolMuted();
+        iPreviousScannedFrequency = 0;
+        iPlayerUtility->Mute( ETrue );
+        iTunerUtility->SetFrequency( minFrequency );
+        Seek( RadioEngine::ERadioUp );
+        }
+    else
+        {
+        TInt error = iScanObserver ? KErrAlreadyExists : KErrNotReady;
+        TRAP_IGNORE( aObserver.ScanCompletedEventL( error ) )
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Stops any scans currently in progress.
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::StopScan( TInt aError )
+    {
+    LOG_FORMAT( "CRadioEngineImp::StopScan, error: %d", aError );
+    if ( iScanObserver )
+        {
+        if ( iSeekingState != RadioEngine::ERadioNotSeeking )
+            {
+            iSeekingState = RadioEngine::ERadioNotSeeking;
+            if ( RadioInitialized() )
+                {
+                iTunerUtility->CancelStationSeek();
+                }
+            }
+
+        iPreviousScannedFrequency = 0;
+        MRadioScanObserver& observer = *iScanObserver;
+        iScanObserver = NULL;
+        NotifyRadioScanEvent( ERadioEventScanCompleted, observer, aError );
+
+        if ( !OkToPlay( iSettings->EngineSettings().MinFrequency() ) )
+            {
+            // Try to reset the frequency as sometimes extra frequency event occurs after seeking
+            iFreqEventReason = RadioEngine::ERadioFrequencyEventReasonImplicit;
+            iTunerUtility->SetFrequency( iSettings->EngineSettings().TunedFrequency() );
+            }
+
+        if ( iPlayerUtility && OkToPlay( iSettings->EngineSettings().TunedFrequency() ) )
+            {
+            iPlayerUtility->Mute( iPreviousMuteState );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Sets volume level up/down one step.
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::AdjustVolume( RadioEngine::TRadioVolumeSetDirection aDirection )
+    {
+    LOG_FORMAT( "CRadioEngineImp::AdjustVolume( %d )", aDirection );
+
+    if ( iSettings->EngineSettings().IsPowerOn() )
+        {
+        TInt volume = iSettings->EngineSettings().Volume();
+        LOG_FORMAT( "CRadioEngineImp::AdjustVolume volume = ( %d )", volume );
+
+        if ( aDirection == RadioEngine::ERadioDecVolume )
+            {
+            TInt min = iSettings->EngineSettings().DefaultMinVolumeLevel();
+            if ( --volume < min )
+                {
+                volume = min;
+                }
+            }
+        else if ( aDirection == RadioEngine::ERadioIncVolume )
+            {
+            TInt max = MaxVolumeLevel();
+
+            if ( ++volume > max )
+                {
+                volume = max;
+                }
+            }
+        else
+            {
+            LOG( "CRadioEngineImp::AdjustVolume - Unhandled case" );
+            }
+        SetVolume( volume );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Sets audio volume level
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::SetVolume( TInt aVolume )
+    {
+    LOG_FORMAT( "CRadioEngineImp::SetVolume vol: %d", aVolume );
+
+    if ( iSettings->EngineSettings().IsPowerOn() && RadioInitialized() )
+        {
+        LOG( "CRadioEngineImp::SetVolume: Setting volume to player utility" );
+
+        if ( aVolume == 0 )
+            {
+            SetVolumeMuted( ETrue );
+            }
+        else
+            {
+            if ( iSettings->EngineSettings().IsVolMuted() )
+                {
+                SetVolumeMuted( EFalse );
+                }
+            else if ( iPlayerUtility->SetVolume( TunerVolumeForUiVolume( aVolume ) ) == KErrNone )
+                {
+                iSettings->RadioSetter().SetVolume( aVolume );
+                NotifyRadioEvent( ERadioEventVolume, KErrNone );
+                }
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Set radio audio muted/unmuted
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::SetVolumeMuted( TBool aMuteState )
+    {
+    LOG_METHOD_AUTO;
+    LOG_FORMAT( "MuteState = %d", aMuteState );
+
+    if ( iSettings->EngineSettings().IsPowerOn() )
+        {
+        TInt err = KErrNone;
+        if ( RadioInitialized() )
+            {
+            err = iPlayerUtility->Mute( aMuteState );
+            iSettings->RadioSetter().SetVolMuted( aMuteState );
+            NotifyRadioEvent( ERadioEventMute, err );
+            }
+        else
+            {
+            err = iSettings->RadioSetter().SetVolMuted( aMuteState );
+            NotifyRadioEvent( ERadioEventMute, err );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioEngineImp::IsAntennaAttached()
+    {
+    LOG_FORMAT( "CRadioEngineImp::IsAntennaAttached, returning %d", iAntennaAttached );
+    return iAntennaAttached;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioEngineImp::IsFmTransmitterActive() const
+    {
+    LOG_FORMAT( "CRadioEngineImp::IsFmTransmitterActive, returning %d", iFmTransmitterActive );
+    return iFmTransmitterActive;
+    }
+
+// ---------------------------------------------------------------------------
+// This function is usable only in WINS emulator.
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::SetAntennaAttached( TBool aAntennaAttached )
+    {
+#ifdef __WINS__
+    MrftoAntennaStatusChange( aAntennaAttached );
+#endif
+    }
+
+// ---------------------------------------------------------------------------
+// If CRadioPlayerUtility has 10 steps, CAknVolumeControl has also 10 steps and also
+// the maximum volume level of Visual radio is 10. Otherwise CRadioPlayerUtility has
+// 200 steps, and CAknVolumeControl has 20 steps, so maximum volume level of Visual radio
+// is 20.
+// ---------------------------------------------------------------------------
+//
+TInt CRadioEngineImp::MaxVolumeLevel() const
+    {
+    TInt maxLevel = 0;
+
+#if defined __WINS__
+    maxLevel = KRadioVolumeStepsOld;
+#else
+    if ( RadioInitialized() )
+        {
+        iPlayerUtility->GetMaxVolume( maxLevel );
+        }
+#endif //defined __WINS__
+
+    if ( maxLevel > KRadioVolumeStepsDividinglimit )
+        {
+        maxLevel = maxLevel / KRadioVolumeStepsDivider;
+        }
+
+    return maxLevel;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioEngineImp::FrequencySetByRdsAf() const
+    {
+    return iFrequencySetByRdsAf;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+MRadioRdsReceiver& CRadioEngineImp::RdsReceiver()
+    {
+    return *iRdsReceiver;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TInt CRadioEngineImp::TunerVolumeForUiVolume( TInt aUiVolume )
+    {
+    TInt vol = aUiVolume * KRadioVolumeStepsDivider;
+
+    return vol;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::NotifyRadioEvent( TInt aRadioEvent, TInt aErrorCode )
+    {
+    TRAP_IGNORE( DoNotifyRadioEventL( aRadioEvent, aErrorCode ) )
+    }
+
+// ---------------------------------------------------------------------------
+// Notifies all the registered observers of radio events
+// by sending notifications to observers.
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::DoNotifyRadioEventL( TInt aRadioEvent, TInt aErrorCode )
+    {
+    TInt count = iObservers.Count();
+
+    for ( TInt i = 0; i<count; i++)
+        {
+        MRadioEngineObserver * observer = iObservers[i];
+
+        switch ( aRadioEvent )
+            {
+            case ERadioEventPower:
+                {
+                observer->PowerEventL( iSettings->EngineSettings().IsPowerOn(), aErrorCode );
+                break;
+                }
+            case ERadioEventFrequency:
+                {
+                observer->FrequencyEventL( iSettings->EngineSettings().TunedFrequency(),
+                                           iFreqEventReason, aErrorCode );
+                break;
+                }
+            case ERadioEventVolume:
+                {
+                observer->VolumeEventL( iSettings->EngineSettings().Volume(), aErrorCode );
+                break;
+                }
+            case ERadioEventMute:
+                {
+                if ( !iScanObserver )
+                    {
+                    observer->MuteEventL( iSettings->EngineSettings().IsVolMuted(), aErrorCode );
+                    }
+                break;
+                }
+            case ERadioEventAudioMode:
+                {
+                observer->AudioModeEventL( iSettings->EngineSettings().OutputMode(), aErrorCode );
+                break;
+                }
+            case ERadioEventAntenna:
+                {
+                observer->AntennaEventL( iAntennaAttached, aErrorCode );
+                break;
+                }
+            case ERadioEventAudioRouting:
+                {
+                observer->AudioRoutingEventL( iSettings->EngineSettings().AudioRoute(), aErrorCode );
+                break;
+                }
+            case ERadioEventSeeking:
+                {
+                observer->SeekingEventL( iSeekingState, aErrorCode );
+                break;
+                }
+            case ERadioEventRegion:
+                {
+                observer->RegionEventL( iSettings->EngineSettings().RegionId(), aErrorCode );
+                break;
+                }
+            case ERadioEventFmTransmitter:
+                {
+                observer->FmTransmitterEventL( iFmTransmitterActive );
+                break;
+                }
+            default:
+                {
+                break;
+                }
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Notifies the observer of a radio scan event.
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::NotifyRadioScanEvent( TRadioScanEvent aEvent,
+                                            MRadioScanObserver& aObserver,
+                                            TInt aError  )
+    {
+    TRAP_IGNORE( DoNotifyRadioScanEventL( aEvent, aObserver, aError ) )
+    }
+
+// ---------------------------------------------------------------------------
+// Notifies the observer of a radio scan event.
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::DoNotifyRadioScanEventL( TRadioScanEvent aEvent,
+                                               MRadioScanObserver& aObserver,
+                                               TInt aError )
+    {
+    LOG_FORMAT( "CRadioEngineImp::DoNotifyRadioScanEventL, aEvent: %d, aError: %d", aEvent, aError );
+
+    if ( aEvent == ERadioEventFrequencyScanned )
+        {
+        if ( aError == KErrNone )
+            {
+            aObserver.ScanFrequencyEventL( iPreviousScannedFrequency );
+            }
+        }
+    else if ( aEvent == ERadioEventScanCompleted )
+        {
+        // KFmRadioErrTuning error means that no channels can be found anymore
+        if ( aError == KFmRadioErrTuning )
+            {
+            aError = KErrNotFound;
+            }
+
+        aObserver.ScanCompletedEventL( aError );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Handles some system events
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::HandleSystemEventL( TRadioSystemEventType aEventType )
+    {
+    LOG_FORMAT( "CRadioEngineImp::HandleSystemEventL, aEventType = %d", aEventType );
+
+    switch ( aEventType )
+        {
+        case ERadioAudioResourcesAvailable:
+            {
+            LOG( "CRadioEngineImp::HandleSystemEventL, Audio resources available" );
+            SwitchPower( ETrue );
+            }
+            break;
+
+        case ERadioAudioAutoResumeForbidden:
+            {
+            EnableAudio( EFalse );
+            }
+            break;
+
+        case ERadioAudioRouteHeadset:
+            {
+            HandleAudioRoutingEvent( RadioEngine::ERadioHeadset );
+            }
+            break;
+
+        case ERadioAudioRouteSpeaker:
+            {
+            HandleAudioRoutingEvent( RadioEngine::ERadioSpeaker );
+            }
+            break;
+
+        case ERadioCallActivated:
+            {
+            StopScan( KErrGeneral );
+            CancelSeek();
+            }
+            break;
+
+        case ERadioCallDeactivated:
+            {
+            SwitchPower( ETrue );
+            }
+            break;
+
+        case ERadioHeadsetConnected:
+            {
+            // Explicitly set the audio routing to headset. Because system
+            // forces the routing to headset anyway, and without our knowledge.
+            iAudioRouter->SetAudioRouteL( RadioEngine::ERadioHeadset );
+            }
+            break;
+
+        case ERadioHeadsetDisconnected:
+            {
+            // Explicitly set the audio routing to speaker. Because system
+            // forces the routing to speaker anyway, if radio stays on.
+            iAudioRouter->SetAudioRouteL( RadioEngine::ERadioSpeaker );
+            }
+            break;
+        default:
+            {
+            break;
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::MrftoRequestTunerControlComplete( TInt aError )
+    {
+    LOG_FORMAT( "CRadioEngineImp::MrftoRequestTunerControlComplete( %d )", aError );
+
+    if ( aError == KErrNone || aError == KErrAlreadyExists ) // Tuner activated now or was already active
+        {
+        iRadioInitializationState = ERadioTunerControlGranted;
+
+        TFmTunerCapabilities tunerCaps;
+        tunerCaps.iTunerBands = 0;
+        tunerCaps.iTunerFunctions = 0;
+        tunerCaps.iAdditionalFunctions1 = 0;
+        tunerCaps.iAdditionalFunctions2 = 0;
+        iTunerUtility->GetCapabilities( tunerCaps );
+
+#ifdef LOGGING_ENABLED
+        TBuf<50> tunerCapsBuf;
+        if ( tunerCaps.ETunerAvailableInOfflineMode )
+            {
+            tunerCapsBuf.Append( _L("OfflineMode ") );
+            }
+        if ( tunerCaps.ETunerRdsSupport )
+            {
+            tunerCapsBuf.Append( _L("RDS ") );
+            }
+        if ( tunerCaps.ETunerDualTunerSupport )
+            {
+            tunerCapsBuf.Append( _L("DualTuner ") );
+            }
+        LOG_FORMAT( "Radio tuner capabilities: %S", &tunerCapsBuf );
+
+#endif // LOGGING_ENABLED
+
+        TBool offlineAvailable( tunerCaps.iTunerFunctions &
+                                TFmTunerCapabilities::ETunerAvailableInOfflineMode );
+        iTunerUtility->EnableTunerInOfflineMode( offlineAvailable );
+
+        TBool rdsSupported = EFalse;
+        TRAP_IGNORE( CRadioRepositoryManager::GetRepositoryValueL( KRadioCRUid, KRadioCRRdsSupport,
+                                                                   rdsSupported ) )
+        if ( tunerCaps.iTunerFunctions & TFmTunerCapabilities::ETunerRdsSupport &&
+                rdsSupported )
+            {
+            TRAP_IGNORE( iRdsReceiver->InitL( *iRadioUtility, iPubSub ) )
+            }
+
+        iTunerUtility->SetFrequencyRange( TunerFrequencyRangeForRegionId(
+                                          iSettings->EngineSettings().RegionId() ) );
+        // To prevent false frequency changes
+        iTunerUtility->SetFrequency( iSettings->EngineSettings().TunedFrequency() );
+        SwitchPower( ETrue );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::MrftoSetFrequencyRangeComplete( TInt aError )
+    {
+    LOG_FORMAT( "CRadioEngineImp::MrftoSetFrequencyRangeComplete( %d )", aError );
+    if ( aError )
+        {
+        NotifyRadioEvent( ERadioEventRegion, aError );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::MrftoSetFrequencyComplete( TInt aError )
+    {
+    LOG_FORMAT( "CRadioEngineImp::MrftoSetFrequencyComplete: Err: %d", aError );
+
+    if ( aError )
+        {
+        if ( aError == KErrNotReady )
+            {
+            iRadioInitializationState = ERadioUtilitiesConstructed;
+            }
+        HandleFrequencyEvent( iSettings->EngineSettings().TunedFrequency(), aError );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::MrftoStationSeekComplete( TInt aError, TInt aFrequency )
+    {
+    LOG_FORMAT( "CRadioEngineImp::MrftoStationSeekComplete() -- aError = %d, aFrequency = %d", aError, aFrequency );
+    // Seeking has ended, error code tells if it was successful
+
+    if ( aError == KFmRadioErrAntennaNotConnected )
+        {
+        iAntennaAttached = EFalse;
+        }
+    else if ( aError == KErrNotReady )
+        {
+        iRadioInitializationState = ERadioUtilitiesConstructed;
+        }
+
+    iSeekingState = RadioEngine::ERadioNotSeeking;
+
+    NotifyRadioEvent( ERadioEventSeeking, aError );
+
+//    if ( aError != KErrNone )
+//        {
+//        iFreqEventReason = RadioEngine::ERadioFrequencyEventReasonImplicit;
+//        NotifyRadioEvent( ERadioEventFrequency, KErrNone ); // Frequency change is not otherwise notified when seeking fails.
+//        }
+//    else
+//        {
+//        // sometimes frequency change is not reported even if seeking succeeds
+//        if ( !iFrequencySetByRdsAf )
+//            {
+//            NotifyRadioEvent( ERadioEventFrequency, KErrNone );
+//            }
+//        }
+
+    if ( iScanObserver )
+        {
+        if ( aError != KErrNone )
+            {
+            StopScan( aError );
+            }
+        else
+            {
+            if ( aFrequency > iSettings->EngineSettings().MinFrequency() && aFrequency > iPreviousScannedFrequency )
+                {
+                iPreviousScannedFrequency = aFrequency;
+                NotifyRadioScanEvent( ERadioEventFrequencyScanned, *iScanObserver, KErrNone );
+                Seek( RadioEngine::ERadioUp ); // Continue scanning.
+                }
+            else
+                {
+                if ( aFrequency == iSettings->EngineSettings().MinFrequency() )
+                    {
+                    iPreviousScannedFrequency = aFrequency;
+                    NotifyRadioScanEvent( ERadioEventFrequencyScanned, *iScanObserver, KErrNone );
+                    }
+                StopScan( aError );
+                }
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::MrftoFmTransmitterStatusChange( TBool aActive )
+    {
+    LOG_FORMAT( "CRadioEngineImp::MrftoFmTransmitterStatusChange( %d )", aActive );
+    iFmTransmitterActive = aActive;
+
+    if ( !iFmTransmitterActive )
+        {
+        SwitchPower( ETrue );
+        }
+
+    NotifyRadioEvent( ERadioEventFmTransmitter );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::MrftoAntennaStatusChange( TBool aAttached )
+    {
+    LOG_FORMAT( "CRadioEngineImp::MrftoAntennaStatusChange( %d )", aAttached );
+    iAntennaAttached = aAttached;
+    if ( iAntennaAttached )
+        {
+        SwitchPower( ETrue );
+        NotifyRadioEvent( ERadioEventAntenna );
+        iPubSub->PublishAntennaState( ERadioPSRadioAntennaAttached );
+        }
+    else
+        {
+        NotifyRadioEvent( ERadioEventAntenna, KErrDisconnected );
+        iPubSub->PublishAntennaState( ERadioPSRadioAntennaDetached );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+
+//
+void CRadioEngineImp::MrftoOfflineModeStatusChange( TBool DEBUGVAR( aOfflineMode ) )
+    {
+    LOG_FORMAT( "CRadioEngineImp::MrftoOfflineModeStatusChange( %d )", aOfflineMode );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::MrftoFrequencyRangeChange( TFmRadioFrequencyRange DEBUGVAR( aBand ) )
+    {
+    LOG_FORMAT( "CRadioEngineImp::MrftoFrequencyRangeChange( %d )", aBand );
+    if ( RadioInitialized() )
+        {
+        iTunerUtility->SetFrequency( iSettings->EngineSettings().TunedFrequency() );
+        iFreqEventReason = RadioEngine::ERadioFrequencyEventReasonImplicit;
+        }
+    NotifyRadioEvent( ERadioEventRegion );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::MrftoFrequencyChange( TInt aNewFrequency )
+    {
+    LOG_FORMAT( "CRadioEngineImp::MrftoFrequencyChange aNewFrequency = %u", aNewFrequency );
+
+    // There may be frequency changed events when radio is not initialized ( because
+    // of SetFrequency or Seek returns with KErrNotReady ).
+    if ( RadioInitialized() )
+        {
+      
+        HandleFrequencyEvent( aNewFrequency );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::MrftoForcedMonoChange( TBool aForcedMono )
+    {
+    LOG_FORMAT( "CRadioEngineImp::MrftoForcedMonoChange -- aForcedMono = %d", aForcedMono );
+
+    iSettings->RadioSetter().SetOutputMode( aForcedMono ? RadioEngine::ERadioMono : RadioEngine::ERadioStereo );
+    NotifyRadioEvent( ERadioEventAudioMode );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::MrftoSquelchChange( TBool /*aSquelch*/ )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::MrpoStateChange( TPlayerState aState, TInt aError )
+    {
+    LOG_FORMAT( "CRadioEngineImp::MrpoStateChange() -- aState = %d, aError = %d", aState, aError );
+
+    if ( aError == KFmRadioErrAntennaNotConnected )
+        {
+        iAntennaAttached = EFalse;
+        }
+    HandlePowerEvent( aState == ERadioPlayerPlaying, aError );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::MrpoVolumeChange( TInt aVolume )
+    {
+    aVolume = aVolume / KRadioVolumeStepsDivider;
+    LOG_FORMAT( "CRadioEngineImp::MrpoVolumeChange() --  volume = %d", aVolume );
+    if ( aVolume != iSettings->EngineSettings().Volume() )
+        {
+        iSettings->RadioSetter().SetVolume( aVolume );
+        NotifyRadioEvent( ERadioEventVolume );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::MrpoMuteChange( TBool aMute )
+    {
+    TBool muted = iSettings->EngineSettings().IsVolMuted();
+    if ( !iScanObserver && !aMute != !muted )
+        {
+        iSettings->RadioSetter().SetVolMuted( aMute );
+        NotifyRadioEvent( ERadioEventMute );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::MrpoBalanceChange( TInt /*aLeftPercentage*/, TInt /*aRightPercentage*/ )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::RdsAfSearchSettingChangedL( TBool aEnabled )
+    {
+    LOG_FORMAT( "CRadioEngineImp::RdsAfSearchSettingChangedL( %d )", aEnabled );
+    iRdsReceiver->SetAutomaticSwitchingL( aEnabled );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::RegionSettingChangedL( TInt DEBUGVAR( aRegion ) )
+    {
+    LOG_FORMAT( "CRadioEngineImp::RegionSettingChangedL( %d )", aRegion );
+
+    if ( RadioInitialized() )
+        {
+        iTunerUtility->SetFrequencyRange( TunerFrequencyRangeForRegionId( iSettings->EngineSettings().RegionId() ) );
+        iTunerUtility->SetFrequency( iSettings->EngineSettings().TunedFrequency() );
+        iFreqEventReason = RadioEngine::ERadioFrequencyEventReasonImplicit;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::RdsAfSearchBegin()
+    {
+    LOG( "CRadioEngineImp::RdsAfSearchBegin()" );
+    iFrequencySetByRdsAf = ETrue;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::RdsAfSearchEnd( TUint32 DEBUGVAR( aFrequency ), TInt aError )
+    {
+    LOG_FORMAT( "CRadioEngineImp::RdsAfSearchEnd( %d, %d )", aFrequency, aError );
+    if ( aError != KErrNone )
+        {
+        iFrequencySetByRdsAf = EFalse;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Tries to figure the region out based on current mobile network id
+// ---------------------------------------------------------------------------
+//
+TRadioRegion CRadioEngineImp::RegionFromMobileNetwork() const
+    {
+    TRadioRegion region = ERadioRegionNone;
+
+    // Choose the frequency range according to country code
+    MRadioEngineSettings& engineSettings = iSettings->EngineSettings();
+    const TDesC& countryCode = engineSettings.CountryCode();
+    const TInt regionCount = engineSettings.CountRegions();
+    TBool matchFound = EFalse;
+    for ( TInt i = 0; i < regionCount && !matchFound; ++i )
+        {
+        const RRadioCountryCodeArray& regionCountryCodes =
+                engineSettings.Region( i ).CountryCodes();
+
+        const TInt countryCodeCount = regionCountryCodes.Count();
+        for ( TInt j = 0; j < countryCodeCount && !matchFound; ++j )
+            {
+            if ( countryCode == *regionCountryCodes[j] )
+                {
+                // We have a match
+                matchFound = ETrue;
+                region = engineSettings.Region( i ).Id();
+                }
+            }
+        }
+
+    return region;
+    }
+
+// ---------------------------------------------------------------------------
+// Tries to figure the region out based on timezone selection
+// ---------------------------------------------------------------------------
+//
+TRadioRegion CRadioEngineImp::RegionFromTimezone() const
+    {
+    TRadioRegion region = ERadioRegionNone;
+    TRAP_IGNORE( region = DoRegionFromTimezoneL() );
+    return region;
+    }
+
+// ---------------------------------------------------------------------------
+// Performs the timezone-based check
+// ---------------------------------------------------------------------------
+//
+TRadioRegion CRadioEngineImp::DoRegionFromTimezoneL() const
+    {
+    LOG_METHOD_AUTO;
+    CTzLocalizer* timezoneLocalizer = CTzLocalizer::NewL();
+    CleanupStack::PushL( timezoneLocalizer );
+
+    CTzLocalizedCityGroupArray* cityGroups = timezoneLocalizer->GetAllCityGroupsL(
+                                            CTzLocalizer::ETzAlphaNameAscending );
+    CleanupStack::PushL( cityGroups );
+
+    // We get the ownership so we must delete
+    CTzLocalizedCity* city = timezoneLocalizer->GetFrequentlyUsedZoneCityL( CTzLocalizedTimeZone::ECurrentZone );
+    const TUint8 cityId = city->GroupId();
+    delete city;
+    city = NULL;
+    LOG_FORMAT( "CRadioEngineHandler::CurrentTimeZoneToRegionL group id: %d", cityId );
+
+    TRadioRegion region = ERadioRegionNone;
+    const TInt cityGroupCount = cityGroups->Count();
+    TBool found = EFalse;
+    for ( TInt i = 0; i < cityGroupCount && !found; ++i )
+        {
+        if ( cityId == cityGroups->At( i ).Id() )
+            {
+            region = static_cast<TRadioRegion>( KCityGroupRegions[ cityId - 1 ] );
+            found = ETrue;
+            }
+        }
+
+    CleanupStack::PopAndDestroy( cityGroups );
+    CleanupStack::PopAndDestroy( timezoneLocalizer );
+
+    LOG_ASSERT( found, LOG_FORMAT( "CRadioEngine::DoMapCurrentTimeZoneToRegionL. City not found: %d", cityId ) );
+
+    return region;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::HandleAudioRoutingEvent( RadioEngine::TRadioAudioRoute aDestination )
+    {
+    LOG_FORMAT( "CRadioEngineImp::HandleAudioRoutingL( %d )", aDestination );
+
+    // Make modifications to volume ONLY if new audio source state
+    // differs from settings. If they don't differ, this state
+    // change is a part of the radio initialization.
+    MRadioSettingsSetter& setter = iSettings->RadioSetter();
+    if ( aDestination != iSettings->EngineSettings().AudioRoute() )
+        {
+        setter.SetAudioRoute( aDestination );
+
+        // If audio muted, change it to minimum volume
+        MRadioEngineSettings& engineSettings = iSettings->EngineSettings();
+        TInt vol = engineSettings.IsVolMuted() ? engineSettings.DefaultMinVolumeLevel()
+                                               : engineSettings.Volume();
+
+        if ( RadioInitialized() )
+            {
+            TInt err = iPlayerUtility->Mute( EFalse );
+            if ( !err )
+                {
+                setter.SetVolMuted( EFalse );
+                err = iPlayerUtility->SetVolume( TunerVolumeForUiVolume( vol ));
+
+                if ( !err )
+                    {
+                    setter.SetVolume( vol );
+                    }
+                }
+            }
+        else
+            {
+            setter.SetVolMuted( EFalse );
+            setter.SetVolume( vol );
+            }
+        NotifyRadioEvent( ERadioEventAudioRouting );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::HandlePowerEvent( TBool aPowerOn, TInt aErrorCode )
+    {
+    LOG_FORMAT( "CRadioEngineImp::HandlePowerEvent( %d, %d )", aPowerOn, aErrorCode );
+
+    const TBool powerState = iSettings->EngineSettings().IsPowerOn();
+    if ( !powerState != !aPowerOn )
+        {
+        iSettings->RadioSetter().SetPowerOn( aPowerOn );
+
+        if ( aPowerOn )
+            {
+            iRdsReceiver->StartReceiver();
+            }
+        else
+            {
+            iRdsReceiver->StopReceiver();
+            }
+        }
+
+    if ( !iSettings->EngineSettings().IsPowerOn() )
+        {
+        StopScan( aErrorCode );
+        CancelSeek();
+        }
+
+    // If we are seeking, power event starts seeking
+    if ( iSeekingState != RadioEngine::ERadioNotSeeking && iSettings->EngineSettings().IsPowerOn() )
+        {
+        // Reset seeking state to enable seeking start
+        RadioEngine::TRadioSeeking oldSeeking = iSeekingState;
+        iSeekingState = RadioEngine::ERadioNotSeeking;
+        Seek( oldSeeking == RadioEngine::ERadioSeekingUp ? RadioEngine::ERadioUp : RadioEngine::ERadioDown );
+        }
+
+    if ( !powerState != !aPowerOn )
+        {
+        NotifyRadioEvent( ERadioEventPower, aErrorCode );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineImp::HandleFrequencyEvent( TUint32 aFrequency, TInt aErrorCode )
+    {
+    LOG_FORMAT( "CRadioEngineImp::HandleFrequencyEvent( %d, %d )", aFrequency, aErrorCode );
+
+    if ( iSettings->EngineSettings().TunedFrequency() != aFrequency )
+        {
+        if ( iSettings->EngineSettings().IsPowerOn() )
+            {
+            if ( !OkToPlay( aFrequency ) )
+                {
+                // Radio is going to be powered off, stop rds receiver immediately because
+                // some rds data from previous channel might come before power off event.
+                iRdsReceiver->StopReceiver();
+                }
+            else
+                {
+                // Normal frequency change, make sure that rds receiver is started
+                iRdsReceiver->StartReceiver();
+                }
+            }
+        if ( !iFrequencySetByRdsAf )
+            {
+            iRdsReceiver->ClearRdsInformation();
+            }
+        }
+    else if ( iFrequencySetByRdsAf )
+        {
+        // frequency didn't change, so AF search didn't complete successfully
+        iFrequencySetByRdsAf = EFalse;
+        }
+
+    iSettings->RadioSetter().SetTunedFrequency( aFrequency );
+
+    NotifyRadioEvent( ERadioEventFrequency, aErrorCode );
+    iFreqEventReason = RadioEngine::ERadioFrequencyEventReasonUnknown;
+
+    if ( aErrorCode == KErrNone )
+        {
+        SwitchPower( iRadioEnabled && OkToPlay( aFrequency ) );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Routing is not possible when headset is not available, power is off or
+// audio routing is not supported.
+// ---------------------------------------------------------------------------
+//
+TBool CRadioEngineImp::IsAudioRoutingPossible() const
+    {
+    TBool headsetConnected = EFalse;
+    TRAP_IGNORE( ( headsetConnected = iSystemEventCollector->IsHeadsetConnectedL() ) )
+
+    TBool powerOn = iSettings->EngineSettings().IsPowerOn();
+
+    TBool isAudioRoutingPossible = EFalse;
+    if ( headsetConnected && powerOn && AudioRoutingSupported() )
+        {
+        isAudioRoutingPossible = ETrue;
+        }
+
+    return isAudioRoutingPossible;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/engine/src/cradionetworkinfolistener.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,308 @@
+/*
+* 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:
+*
+*/
+
+// System includes
+#include <etelmm.h>
+#include <commsdattypesv1_1.h>
+
+// User includes
+#include "cradionetworkinfolistener.h"
+#include "mradiosettingssetter.h"
+#include "cradioenginelogger.h"
+
+using namespace CommsDat;
+
+// ======== MEMBER FUNCTIONS ========
+
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioNetworkInfoListener* CRadioNetworkInfoListener::NewL( MRadioSettingsSetter& aSetter,
+                                                            MRadioNetworkChangeObserver* aObserver )
+    {
+    CRadioNetworkInfoListener* self = new ( ELeave ) CRadioNetworkInfoListener( aSetter, aObserver );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioNetworkInfoListener::CRadioNetworkInfoListener( MRadioSettingsSetter& aSetter,
+                                                      MRadioNetworkChangeObserver* aObserver )
+    : CActive( CActive::EPriorityHigh )
+    , iSetter( aSetter )
+    , iObserver( aObserver )
+    , iSubscriberIdPckg( iSubscriberId )
+    , iNetworkInfoPckg( iNetworkInfo )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioNetworkInfoListener::ConstructL()
+    {
+    LOG_METHOD_AUTO;
+#ifndef __WINS__
+    iTelephony = CTelephony::NewL();
+
+    // Initialize the default network id and country code directly from CommsDat, as CTelephony cannot be used in synchronous mode
+    // and using it in async mode will cause problems in core initialisation, and too much complexity!
+
+    // Get default TSY from database.
+
+    CMDBSession* db = CMDBSession::NewL( CMDBSession::LatestVersion());
+    CleanupStack::PushL( db );
+
+    CMDBRecordSet<CCDModemBearerRecord>* set = new ( ELeave ) CMDBRecordSet<CCDModemBearerRecord>( KCDTIdModemBearerRecord );
+    CleanupStack::PushL( set );
+
+    set->LoadL( *db );
+
+    TInt index = 0;
+    CCDModemBearerRecord* record = static_cast<CCDModemBearerRecord*>( set->iRecords[index++]);
+
+    if ( record->iTsyName.IsNull() && set->iRecords.Count() > index ) // the first item is normally only a template
+        {
+        record = static_cast<CCDModemBearerRecord*>( set->iRecords[index++]);
+        }
+
+    TPtrC name( static_cast<const TDesC&>( record->iTsyName ));
+    TBuf<50> tsyName;
+    tsyName.Copy( name );
+
+    LOG_FORMAT( "CRadioNetworkInfoListener::ConstructL, TSY name: %S", &tsyName );
+    CleanupStack::PopAndDestroy( set );
+    CleanupStack::PopAndDestroy( db );
+
+    RTelServer telServer;
+    CleanupClosePushL( telServer );
+    RMobilePhone mobilePhone;
+    CleanupClosePushL( mobilePhone );
+
+    //  Open phone
+    User::LeaveIfError( telServer.Connect());
+
+    // TSY module gets automatically unloaded when tel.Close() is called ( and tel is is CU-stack ),
+    // so loaded TSY is also leave-safe
+    User::LeaveIfError( telServer.LoadPhoneModule( tsyName ));
+
+    // Get number of phones.
+    TInt phones( 0 );
+    User::LeaveIfError( telServer.EnumeratePhones( phones ));
+    LOG_FORMAT( "CRadioNetworkInfoListener::ConstructL, Number of phones=%d", phones );
+
+    // Get phone info of first legal phone.
+    TInt legalPhoneIndex = KErrNotFound;
+    RTelServer::TPhoneInfo phoneInfo;
+    for ( TInt i=0; i<phones && legalPhoneIndex == KErrNotFound; i++)
+        {
+        if ( telServer.GetPhoneInfo( i, phoneInfo ) == KErrNone )
+            {
+            if ( phoneInfo.iNetworkType == RTelServer::ENetworkTypeMobileDigital )
+                {
+                legalPhoneIndex = i;
+                }
+            }
+        }
+    User::LeaveIfError( legalPhoneIndex );
+
+    // Open legal phone.
+    User::LeaveIfError( mobilePhone.Open( telServer, phoneInfo.iName ));
+
+    TUint32 networkCaps;
+    User::LeaveIfError( mobilePhone.GetNetworkCaps( networkCaps ));
+    TUint32 identityCaps;
+    User::LeaveIfError( mobilePhone.GetIdentityCaps( identityCaps ));
+    // Check if we are allowed to get network info.
+    if ( networkCaps & RMobilePhone::KCapsGetCurrentNetwork )
+        {
+        // Gather initial information synchronically.
+        RMobilePhone::TMobilePhoneLocationAreaV1 location;
+
+        RMobilePhone::TMobilePhoneNetworkInfoV1 networkInfo;
+        RMobilePhone::TMobilePhoneNetworkInfoV1Pckg networkInfoPckg( networkInfo );
+
+        mobilePhone.GetCurrentNetwork( iStatus, networkInfoPckg, location );
+        User::WaitForRequest( iStatus );
+
+        CTelephony::TNetworkInfoV1 telephonyNetworkInfo;
+        if ( iStatus == KErrNone )
+            {
+            telephonyNetworkInfo.iMode = static_cast<CTelephony::TNetworkMode>( networkInfo.iMode );
+            telephonyNetworkInfo.iCountryCode = networkInfo.iCountryCode;
+            telephonyNetworkInfo.iCdmaSID = networkInfo.iCdmaSID;
+            telephonyNetworkInfo.iNetworkId = networkInfo.iNetworkId;
+            }
+        else
+            {
+            telephonyNetworkInfo.iCountryCode = iSetter.CountryCode();
+            telephonyNetworkInfo.iNetworkId = iSetter.NetworkId();
+            }
+            iNetworkInfoPckg() = telephonyNetworkInfo;
+        }
+    else
+        {
+        // Leave if we are not allowed to get network info.
+        // Other action could also be considered!!!!
+        User::Leave( KErrNotSupported );
+        }
+
+    if ( identityCaps & RMobilePhone::KCapsGetSubscriberId )
+        {
+        TRequestStatus stat;
+        RMobilePhone::TMobilePhoneSubscriberId subscriberId;
+        mobilePhone.GetSubscriberId( stat, subscriberId );
+        User::WaitForRequest( stat );
+
+        CTelephony::TSubscriberIdV1 telephonySubscriberId;
+
+        if ( stat == KErrNone )
+            {
+            telephonySubscriberId.iSubscriberId = subscriberId;
+            }
+        else
+            {
+            telephonySubscriberId.iSubscriberId = iSetter.SubscriberId();
+            }
+
+        iSubscriberIdPckg() = telephonySubscriberId;
+        }
+
+    CleanupStack::PopAndDestroy( 2, &telServer );
+#endif
+    // At the end, update the local variables by simulating the "netid changed" event.
+    RunL();
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioNetworkInfoListener::~CRadioNetworkInfoListener()
+    {
+    Cancel();
+
+#ifndef __WINS__
+    delete iTelephony;
+#endif
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TInt CRadioNetworkInfoListener::CompoundNetworkId() const
+    {
+    LOG_FORMAT( "CRadioNetworkInfoListener::CompoundNetworkId() - %d", iCompoundNetworkId );
+    return iCompoundNetworkId;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TPtrC CRadioNetworkInfoListener::SubscriberId() const
+    {
+    TPtrC id = iSubscriberId.iSubscriberId;
+    LOG_FORMAT( "CRadioNetworkInfoListener::SubscriberId() - %S", &id );
+    return id;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TPtrC CRadioNetworkInfoListener::CountryCode() const
+    {
+    TPtrC countryCode = iSetter.CountryCode();
+    LOG_FORMAT( "CRadioNetworkInfoListener::CountryCode() - %S", &countryCode );
+    return countryCode;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioNetworkInfoListener::SaveNetworkInfoL()
+    {
+#ifdef __WINS__
+    iNetworkInfo.iCountryCode.Copy( _L("244") );
+    iNetworkInfo.iNetworkId.Zero();
+#endif
+
+    LOG_FORMAT( "CRadioNetworkInfoListener::SaveNetworkInfoL() - iNetworkInfo.iCountryCode = %S",
+                  &iNetworkInfo.iCountryCode );
+
+    User::LeaveIfError( iSetter.SetCountryCode( iNetworkInfo.iCountryCode ) );
+
+    // The compound network identifier is composed of the current network identifier and country code.
+    TBuf<KDefaultRealWidth> compoundNetworkId;
+    compoundNetworkId.Append( iSetter.CountryCode() );
+    if ( iNetworkInfo.iNetworkId.Length() < 2 )
+        {
+        // Network identifier has only one digit, in which case it must be prepended with a zero.
+        compoundNetworkId.AppendNum( 0 );
+        }
+
+    compoundNetworkId.Append( iNetworkInfo.iNetworkId );
+
+    TLex lex( compoundNetworkId );
+    User::LeaveIfError( lex.Val( iCompoundNetworkId ) );
+
+    if ( iCompoundNetworkId != 0 && iPreviousCompoundNetworkId != iCompoundNetworkId )
+        {
+        if ( iPreviousCompoundNetworkId != 0 && iObserver )
+            {
+            iObserver->NetworkIdChanged();
+            }
+        iPreviousCompoundNetworkId = iCompoundNetworkId;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioNetworkInfoListener::DoCancel()
+    {
+#ifndef __WINS__
+    iTelephony->CancelAsync( CTelephony::ECurrentNetworkInfoChangeCancel );
+#endif
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioNetworkInfoListener::RunL()
+    {
+    LOG_FORMAT( "CRadioNetworkInfoListener::RunL() - iStatus.Int() = %d", iStatus.Int() );
+#ifndef __WINS__
+    iTelephony->NotifyChange( iStatus, CTelephony::ECurrentNetworkInfoChange, iNetworkInfoPckg );
+    SetActive();
+#endif
+    SaveNetworkInfoL();
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/engine/src/cradiordsreceiver.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,218 @@
+/*
+* 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:
+*
+*/
+
+// User includes
+#include "cradiordsreceiver.h"
+#include "mradioenginesettings.h"
+#include "mradiordsdataobserver.h"
+#include "cradioenginelogger.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioRdsReceiver::CRadioRdsReceiver( MRadioEngineSettings& aSettings )
+    : CRadioRdsReceiverBase( aSettings )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRdsReceiver::ConstructL()
+    {
+    BaseConstructL();
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioRdsReceiver* CRadioRdsReceiver::NewL( MRadioEngineSettings& aSettings )
+    {
+    CRadioRdsReceiver* self = new ( ELeave ) CRadioRdsReceiver( aSettings );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioRdsReceiver::~CRadioRdsReceiver()
+    {
+    if ( iRdsUtility )
+        {
+        iRdsUtility->Close();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRdsReceiver::InitL( CRadioUtility& aRadioUtility, CRadioPubSub* aPubSub )
+    {
+    LOG_METHOD_AUTO;
+    iPubSub = aPubSub;
+
+    iRdsUtility = &aRadioUtility.RadioRdsUtilityL( *this );
+
+    LogReceiverCapabilities();
+
+    SetAutomaticSwitchingL( iSettings.RdsAfSearchEnabled() );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRdsReceiver::SetAutomaticSwitchingL( TBool aEnable )
+    {
+    if ( iRdsUtility )
+        {
+        User::LeaveIfError( iRdsUtility->SetAutomaticSwitching( aEnable ) );
+        }
+
+    // Notifies the observers
+    CRadioRdsReceiverBase::SetAutomaticSwitchingL( aEnable );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRdsReceiver::StartReceiver()
+    {
+    // Request to be notified of almost all RDS data.
+    // Unwanted RDS values:
+    //    ERdsClockTime
+    //    ERdsTrafficProgramme
+    //    ERdsTrafficAnnouncement
+    //    ERdsAlternateFrequency
+    TRdsData rdsData;
+    rdsData.iRdsFunctions = ERdsProgrammeIdentification |
+                            ERdsProgrammeType |
+                            ERdsProgrammeService |
+                            ERdsRadioText |
+                            ERdsRadioTextPlus;
+
+    rdsData.iAdditionalFunctions1 = 0;
+    rdsData.iAdditionalFunctions2 = 0;
+
+    LOG_ASSERT( iRdsUtility, LOG( "CRadioRdsReceiver::StartReceiverL. Error: RDS utility not created!" ) );
+    if ( iRdsUtility && !iStarted )
+        {
+        TInt err = iRdsUtility->NotifyRdsDataChange( rdsData );
+        if ( !err )
+            {
+            // Avoid further calls
+            iStarted = ETrue;
+            LOG( "CRadioRdsReceiver::StartReceiverL: Requested RDS notifications from receiver." );
+            }
+        else
+            {
+            LOG_FORMAT( "CRadioRdsReceiver::StartReceiverL. Failed to request RDS data with err %d", err );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRdsReceiver::StopReceiver()
+    {
+    LOG( "CRadioRdsReceiver::StopReceiver" );
+
+    if ( iRdsUtility )
+        {
+        iRdsUtility->CancelNotifyRdsDataChange();
+        }
+    iStarted = EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+// Logs the RDS receiver capabilities if logging is enabled
+// ---------------------------------------------------------------------------
+//
+void CRadioRdsReceiver::LogReceiverCapabilities()
+    {
+#ifdef LOGGING_ENABLED
+    // Log the RDS utility capabilities
+    if ( iRdsUtility )
+        {
+        TRdsCapabilities caps;
+        caps.iRdsFunctions = 0;
+        caps.iAdditionalFunctions1 = 0;
+        caps.iAdditionalFunctions2 = 0;
+        TInt err = iRdsUtility->GetCapabilities( caps );
+        if ( !err )
+            {
+            TBuf<100> capsBuf;
+            if ( caps.iRdsFunctions & ERdsProgrammeIdentification == ERdsProgrammeIdentification )
+                {
+                capsBuf.Append( _L("PI ") );
+                }
+            if ( caps.iRdsFunctions & ERdsProgrammeType == ERdsProgrammeType )
+                {
+                capsBuf.Append( _L("Genre ") );
+                }
+            if ( caps.iRdsFunctions & ERdsProgrammeService == ERdsProgrammeService )
+                {
+                capsBuf.Append( _L("PS ") );
+                }
+            if ( caps.iRdsFunctions & ERdsRadioText == ERdsRadioText )
+                {
+                capsBuf.Append( _L("RT ") );
+                }
+            if ( caps.iRdsFunctions & ERdsRadioTextPlus == ERdsRadioTextPlus )
+                {
+                capsBuf.Append( _L("RT+ ") );
+                }
+            if ( caps.iRdsFunctions & ERdsAlternateFrequency == ERdsAlternateFrequency )
+                {
+                capsBuf.Append( _L("AF ") );
+                }
+            if ( caps.iRdsFunctions & ERdsClockTime == ERdsClockTime )
+                {
+                capsBuf.Append( _L("Time ") );
+                }
+            if ( caps.iRdsFunctions & ERdsTrafficProgramme == ERdsTrafficProgramme )
+                {
+                capsBuf.Append( _L("TrafficProgramme ") );
+                }
+            if ( caps.iRdsFunctions & ERdsTrafficAnnouncement == ERdsTrafficAnnouncement )
+                {
+                capsBuf.Append( _L("TrafficAnnouncement ") );
+                }
+            LOG_FORMAT( "CRadioRdsReceiver::LogReceiverCapabilities. RDS receiver capabilities: %S", &capsBuf );
+            LOG_FORMAT( "CRadioRdsReceiver::LogReceiverCapabilities. Functions: %d, AdditionalFunctions1: %d, iAdditionalFunctions2: %d",
+                    caps.iRdsFunctions, caps.iAdditionalFunctions1, caps.iAdditionalFunctions2 );
+            }
+        else
+            {
+            LOG_FORMAT( "CRadioRdsReceiver::LogReceiverCapabilities: Failed to get RDS utility capabilities: err %d", err );
+            }
+        }
+#endif // LOGGING_ENABLED
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/engine/src/cradiordsreceiverbase.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,395 @@
+/*
+* 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:
+*
+*/
+
+// User includes
+#include "cradiopubsub.h"
+#include "cradiordsreceiverbase.h"
+#include "cradioenginelogger.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioRdsReceiverBase::CRadioRdsReceiverBase( MRadioEngineSettings& aSettings )
+    : iSettings( aSettings )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRdsReceiverBase::BaseConstructL()
+    {
+    iPsName = HBufC::NewL( TRdsPSName().MaxLength() );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioRdsReceiverBase::~CRadioRdsReceiverBase()
+    {
+    iObservers.Close();
+    delete iPsName;
+    iRadioText.Close();
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRdsReceiverBase::AddObserverL( MRadioRdsDataObserver* aObserver )
+    {
+    TInt index = iObservers.FindInAddressOrder( aObserver );
+    if ( index == KErrNotFound )
+        {
+        iObservers.InsertInAddressOrderL( aObserver );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRdsReceiverBase::RemoveObserver( MRadioRdsDataObserver* aObserver )
+    {
+    TInt index = iObservers.FindInAddressOrder( aObserver );
+
+    if ( index >= 0 )
+        {
+        iObservers.Remove( index );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioRdsReceiverBase::AutomaticSwitchingEnabled() const
+    {
+    return iAfEnabled;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+const TDesC& CRadioRdsReceiverBase::ProgrammeService() const
+    {
+    return *iPsName;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+const TDesC& CRadioRdsReceiverBase::RadioText() const
+    {
+    return iRadioText;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioRdsReceiverBase::SignalAvailable() const
+    {
+    return iSignalAvailable;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRdsReceiverBase::SetAutomaticSwitchingL( TBool aEnable )
+    {
+    iAfEnabled = aEnable;
+    for ( TInt i = 0 ; i < iObservers.Count(); i++ )
+        {
+        iObservers[i]->RdsAfSearchStateChange( iAfEnabled );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRdsReceiverBase::ClearRdsInformation()
+    {
+    iPsName->Des().Zero();
+    iRadioText.Close();
+
+    if ( iPubSub )
+        {
+        iPubSub->PublishRdsProgramService( *iPsName );
+        }
+
+    MrroRdsEventSignalChange( EFalse );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRdsReceiverBase::MrroStationSeekByPTYComplete( TInt DEBUGVAR( aError ),
+                                                          TInt DEBUGVAR( aFrequency ) )
+    {
+    LOG_FORMAT( "CRadioRdsReceiverBase::MrroStationSeekByPTYComplete: err: %d, frequency: %d ", aError, aFrequency );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRdsReceiverBase::MrroStationSeekByTAComplete( TInt DEBUGVAR( aError ),
+                                                         TInt DEBUGVAR( aFrequency ) )
+    {
+    LOG_FORMAT( "CRadioRdsReceiverBase::MrroStationSeekByTAComplete: err: %d, frequency: %d ", aError, aFrequency );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRdsReceiverBase::MrroStationSeekByTPComplete( TInt DEBUGVAR( aError ),
+                                                         TInt DEBUGVAR( aFrequency ) )
+    {
+    LOG_FORMAT( "CRadioRdsReceiverBase::MrroStationSeekByTPComplete: err: %d, frequency: %d ", aError, aFrequency );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRdsReceiverBase::MrroGetFreqByPTYComplete( TInt DEBUGVAR( aError ),
+                                                      RArray<TInt>& /*aFreqList*/ )
+    {
+    LOG_FORMAT( "CRadioRdsReceiverBase::MrroGetFreqByPTYComplete: err: %d", aError );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRdsReceiverBase::MrroGetFreqByTAComplete( TInt DEBUGVAR( aError ),
+                                                     RArray<TInt>& /*aFreqList*/ )
+    {
+    LOG_FORMAT( "CRadioRdsReceiverBase::MrroGetFreqByTAComplete: err: %d", aError );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRdsReceiverBase::MrroGetPSByPTYComplete( TInt DEBUGVAR( aError ),
+                                                    RArray<TRdsPSName>& /*aPsList*/ )
+    {
+    LOG_FORMAT( "CRadioRdsReceiverBase::MrroGetPSByPTYComplete: err: %d", aError );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRdsReceiverBase::MrroGetPSByTAComplete( TInt DEBUGVAR( aError ),
+                                                   RArray<TRdsPSName>& /*aPsList*/ )
+    {
+    LOG_FORMAT( "CRadioRdsReceiverBase::MrroGetPSByTAComplete: err: %d", aError );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRdsReceiverBase::MrroRdsDataPI( TInt aPi )
+    {
+    LOG_FORMAT( "CRadioRdsReceiverBase::MrroRdsDataPI: PI: %d", aPi );
+    const TInt observerCount = iObservers.Count();
+    const TUint32 frequency = iSettings.TunedFrequency();
+    for ( TInt i = 0; i < observerCount; ++i )
+        {
+        iObservers[i]->RdsDataPiCode( frequency, aPi );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRdsReceiverBase::MrroRdsDataPTY( TRdsProgrammeType aPty )
+    {
+    LOG_FORMAT( "CRadioRdsReceiverBase::MrroRdsDataPTY: PTY: %d", aPty );
+    const TInt observerCount = iObservers.Count();
+    const TUint32 frequency = iSettings.TunedFrequency();
+    for ( TInt i = 0; i < observerCount; ++i )
+        {
+        iObservers[i]->RdsDataGenre( frequency, aPty );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Notifies of the New Programme Service data
+// ---------------------------------------------------------------------------
+//
+void CRadioRdsReceiverBase::MrroRdsDataPS( TRdsPSName& aPs )
+    {
+    LOG_FORMAT( "CRadioRdsReceiverBase::MrroRdsDataPS: PS: %S", &aPs );
+    const TUint32 frequency = iSettings.TunedFrequency();
+    if ( iPubSub )
+        {
+        iPubSub->PublishRdsProgramService( aPs );
+        }
+
+    iPsName->Des().Copy( aPs );
+    const TInt observerCount = iObservers.Count();
+    for ( TInt i = 0; i < observerCount; ++i )
+        {
+        iObservers[i]->RdsDataProgrammeService( frequency, *iPsName );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRdsReceiverBase::MrroRdsDataRT( TRdsRadioText& aRt )
+    {
+    LOG_FORMAT( "CRadioRdsReceiverBase::MrroRdsDataRT: RT: %S", &aRt );
+    iRadioText.Close();
+    iRadioText.Create( aRt );
+
+    const TUint32 frequency = iSettings.TunedFrequency();
+    if ( iPubSub )
+        {
+        iPubSub->PublishRdsRadioText( iRadioText );
+        }
+
+    const TInt observerCount = iObservers.Count();
+    for ( TInt i = 0; i < observerCount; ++i )
+        {
+        iObservers[i]->RdsDataRadioText( frequency, iRadioText );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRdsReceiverBase::MrroRdsDataCT( TDateTime& /*aCt*/ )
+    {
+    LOG( "CRadioRdsReceiverBase::MrroRdsDataCT" );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRdsReceiverBase::MrroRdsDataTA( TBool DEBUGVAR( aTaOn ) )
+    {
+    LOG_FORMAT( "CRadioRdsReceiverBase::MrroRdsDataTA: aTaOn: %d", aTaOn );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRdsReceiverBase::MrroRdsDataRTplus( TRdsRTplusClass aRtPlusClass,
+                                               TRdsRadioText& aRtPlusData )
+    {
+    LOG_FORMAT( "CRadioRdsReceiverBase::MrroRdsDataRTplus: Class: %d, data: %S", aRtPlusClass, &aRtPlusData );
+    const TUint32 frequency = iSettings.TunedFrequency();
+    const TInt observerCount = iObservers.Count();
+    for ( TInt i = 0; i < observerCount; ++i )
+        {
+        iObservers[i]->RdsDataRadioTextPlus( frequency, aRtPlusClass, aRtPlusData );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Notifies of the start of Alternate Frequency search
+// ---------------------------------------------------------------------------
+//
+void CRadioRdsReceiverBase::MrroRdsSearchBeginAF()
+    {
+    LOG( "CRadioRdsReceiverBase::MrroRdsSearchBeginAF" );
+    const TInt observerCount = iObservers.Count();
+    for ( TInt i = 0; i < observerCount; ++i )
+        {
+        iObservers[i]->RdsAfSearchBegin();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Notifies of the end of Alternate Frequency search
+// ---------------------------------------------------------------------------
+//
+void CRadioRdsReceiverBase::MrroRdsSearchEndAF( TInt aError, TInt aFrequency )
+    {
+    LOG_FORMAT( "CRadioRdsReceiverBase::MrroRdsSearchEndAF: err: %d, Frequency: %d", aError, aFrequency );
+    const TInt observerCount = iObservers.Count();
+    for ( TInt i = 0; i < observerCount; ++i )
+        {
+        // Radio utility uses Hz, UI uses kHz. It's ok to divide with 1000, possible lost fractions are useless.
+        iObservers[i]->RdsAfSearchEnd( aFrequency, aError );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRdsReceiverBase::MrroRdsStationChangeTA( TInt DEBUGVAR( aFrequency ) )
+    {
+    LOG_FORMAT( "CRadioRdsReceiverBase::MrroRdsStationChangeTA: Frequency: %d", aFrequency );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRdsReceiverBase::MrroRdsEventAutomaticSwitchingChange( TBool DEBUGVAR( aAuto ) )
+    {
+    LOG_FORMAT( "CRadioRdsReceiverBase::MrroRdsEventAutomaticSwitchingChange: aAuto: %d", aAuto );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRdsReceiverBase::MrroRdsEventAutomaticTrafficAnnouncement( TBool DEBUGVAR( aAuto ) )
+    {
+    LOG_FORMAT( "CRadioRdsReceiverBase::MrroRdsEventAutomaticTrafficAnnouncement: aAuto: %d", aAuto );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRdsReceiverBase::MrroRdsEventSignalChange( TBool aSignal )
+    {
+    LOG_FORMAT( "CRadioRdsReceiverBase::MrroRdsEventSignalChange: aSignal: %d", aSignal );
+    iSignalAvailable = aSignal;
+    const TUint32 frequency = iSettings.TunedFrequency();
+    const TInt observerCount = iObservers.Count();
+    for ( TInt i = 0; i < observerCount; ++i )
+        {
+        iObservers[i]->RdsAvailable( frequency, iSignalAvailable );
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/engine/src/t_cradiordsreceiversimulator.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,283 @@
+/*
+* 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:
+*
+*/
+
+// User includes
+#include "t_cradiordsreceiversimulator.h"
+#include "mradioenginesettings.h"
+
+const TInt KVRRdsEventSimulationDelay = 5000000;
+const TUint KItemRelatedTagsCount = 2; //songTitles, artistNames
+const TUint KRadioTextItemsCount = 3;
+const TUint KRtToRtPlusEventTimeout = 400000; // 400 ms
+const TUint KSubsequentRtPlusEventsTimeout = 200; // 0.02 ms
+                       
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioRdsReceiverSimulator::CRadioRdsReceiverSimulator( MRadioEngineSettings& aSettings )
+    : CRadioRdsReceiverBase( aSettings )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRdsReceiverSimulator::ConstructL()
+    {
+    BaseConstructL();
+    iEventSimulatorTimer = CPeriodic::NewL( CActive::EPriorityUserInput );
+    iEventSimulatorTimer2 = CPeriodic::NewL( CActive::EPriorityUserInput );
+    SetAutomaticSwitchingL( iSettings.RdsAfSearchEnabled() );
+
+    StartReceiver();
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioRdsReceiverSimulator* CRadioRdsReceiverSimulator::NewL( MRadioEngineSettings& aSettings )
+    {
+    CRadioRdsReceiverSimulator* self = new (ELeave) CRadioRdsReceiverSimulator( aSettings );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioRdsReceiverSimulator::~CRadioRdsReceiverSimulator()
+    {
+    if ( iEventSimulatorTimer )
+        {
+        iEventSimulatorTimer->Cancel();
+	    }      
+    if( iEventSimulatorTimer2 )
+        {
+        iEventSimulatorTimer2->Cancel();
+        }
+    delete iEventSimulatorTimer;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRdsReceiverSimulator::InitL( CRadioUtility& /*aRadioUtility*/, CRadioPubSub* aPubSub )
+    {
+    iPubSub = aPubSub;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRdsReceiverSimulator::StartReceiver()
+    {
+    if ( !iEventSimulatorTimer->IsActive() )
+        {
+        iEventSimulatorTimer->Start( TTimeIntervalMicroSeconds32( KVRRdsEventSimulationDelay ),
+                                     TTimeIntervalMicroSeconds32( KVRRdsEventSimulationDelay ),
+                                     TCallBack( StaticRdsSimulationCallback, this ));
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRdsReceiverSimulator::StopReceiver()
+    {
+    iEventSimulatorTimer->Cancel();
+    iEventSimulatorTimer2->Cancel();
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TInt CRadioRdsReceiverSimulator::StaticRdsSimulationCallback( TAny* aSelfPtr )
+    {
+    TRadioRdsSimulationEvent events[] = { ERadioRdsEventSignalOn,
+                                       //ERadioRdsEventAFBegin,
+                                       ERadioRdsEventPS,
+                                       ERadioRdsEventRadioText,
+                                       //ERadioRdsEventRadioTextPlus,
+                                       ERadioRdsEventPS,
+                                       ERadioRdsEventRadioText,
+                                       //ERadioRdsEventRadioTextPlus,
+                                       ERadioRdsEventPS,
+                                       ERadioRdsEventRadioText,
+                                       //ERadioRdsEventRadioTextPlus,
+                                       ERadioRdsEventPS,
+                                       ERadioRdsEventRadioText ,
+                                       //ERadioRdsEventPS,
+                                       //ERadioRdsEventAFEnd,
+                                       ERadioRdsEventSignalOff };
+
+    TRdsPSName serviceNames[] = { _L("Tesla" ), _L("Tesla" ), _L("Tesla" ) };
+    TRdsRadioText radioTexts[] = { _L( "Now playing Madonna Material Girl" ),
+                                   _L( "Hox! Get Motorhead Ace of Spades from music store now for free!" ),
+                                   _L( "Abba station-Waterloo Abba station-Waterloo  Abba station" ) };
+    
+    TInt frequencies[] = { 103100000, 95800000 }; // Frequencies in hz
+    TInt numEvents = sizeof( events ) / sizeof( TRadioRdsSimulationEvent );
+    TInt numServiceNames = sizeof( serviceNames ) / sizeof( TRdsPSName );
+    TInt numFrequencies = sizeof( frequencies ) / sizeof( TInt );
+    // RT ( radioTexts[]) and RT+ ( songTitles[] and artistNames[]) information according to PS names ( serviceNames[]).
+
+    CRadioRdsReceiverSimulator* self = reinterpret_cast<CRadioRdsReceiverSimulator*>( aSelfPtr );
+    if ( self )
+        {
+        switch ( events[self->iEventIterator] )
+            {
+            case ERadioRdsEventSignalOn:
+                {
+                self->MrroRdsEventSignalChange( ETrue );
+                break;
+                }
+
+            case ERadioRdsEventSignalOff:
+                {
+                self->MrroRdsEventSignalChange( EFalse );
+                break;
+                }
+
+            case ERadioRdsEventPS:
+                {
+                // Set RT/RT+ iterator value according to PS name iterator: If ERadioRdsEventRadioText or
+                // ERadioRdsEventRadioTextPlus arrives, displays RT or RT+ according to radio station name.
+                self->iRadioTextIterator = self->iPsIterator;
+                self->MrroRdsDataPS( serviceNames[self->iPsIterator] );
+                self->iPsIterator++;
+                if ( self->iPsIterator >= numServiceNames )
+                    {
+                    self->iPsIterator = 0;
+                    }
+                break;
+                }
+
+            case ERadioRdsEventAFBegin:
+                {
+                if ( self->iSettings.RdsAfSearchEnabled() )
+                    {
+                    self->MrroRdsSearchBeginAF();
+                    }
+                break;
+                }
+
+            case ERadioRdsEventAFEnd:
+                {
+                if ( self->iSettings.RdsAfSearchEnabled() )
+                    {
+                    self->MrroRdsSearchEndAF( KErrNone, frequencies[self->iFrequencyIterator] );
+                    }
+                self->iFrequencyIterator++;
+                if ( self->iFrequencyIterator >= numFrequencies )
+                    {
+                    self->iFrequencyIterator = 0;
+                    }
+                break;
+                }
+            case ERadioRdsEventRadioText:
+                {
+                // Display RT according to PS name.
+                self->MrroRdsDataRT( radioTexts[self->iRadioTextIterator] );
+                // how many times StaticRdsSimulationCallback2 entered
+                if ( self->iRtPlusIterator >= KItemRelatedTagsCount )
+                    {
+                    self->iRtPlusIterator = 0;
+                    }
+                                
+                // start timer for displaying the two consequent RT+ events
+                self->startRTPlusTimer();
+                
+                // how many radio text tags received
+                if( self->iRtIterator >= KRadioTextItemsCount )
+                    {
+                    self->iRtIterator = 1;                    
+                    }
+                else
+                    {
+                    self->iRtIterator++;
+                    }
+                break;
+                }
+            case ERadioRdsEventRadioTextPlus:
+                {
+                // Display RT+ information according to PS name.
+				
+                break;
+                }
+            default:
+                break;
+            }
+        self->iEventIterator++;
+        if ( self->iEventIterator >= numEvents )
+            {
+            self->iEventIterator = 0;
+            }
+        }
+    return KErrNone;
+    }
+
+void CRadioRdsReceiverSimulator::startRTPlusTimer()
+    {
+    
+    iEventSimulatorTimer2->Cancel();
+    if ( !iEventSimulatorTimer2->IsActive() )
+        {        
+        iEventSimulatorTimer2->Start( TTimeIntervalMicroSeconds32( KRtToRtPlusEventTimeout ),
+            TTimeIntervalMicroSeconds32( KSubsequentRtPlusEventsTimeout ),
+            TCallBack( StaticRdsSimulationCallback2, this ));
+        }
+    }
+
+TInt CRadioRdsReceiverSimulator::StaticRdsSimulationCallback2( TAny* aSelfPtr )
+    {    
+    TRdsRadioText songTitles[] = { _L( "Material Girl" ),
+                                   _L( "Ace of Spades" ),
+                                   _L( "Waterloo" ) };
+    TRdsRadioText artistNames[] = { _L( "Madonna" ),
+                                    _L( "Motorhead" ),
+                                    _L( "Abba" ) };
+
+    CRadioRdsReceiverSimulator* self = reinterpret_cast<CRadioRdsReceiverSimulator*>( aSelfPtr );
+    
+    if ( self )
+        {
+        if( self->iRtPlusIterator == 0 )
+            {
+            self->MrroRdsDataRTplus( ERTplusItemTitle, songTitles[self->iRtIterator-1] );
+            }
+        else if( self->iRtPlusIterator == 1 )
+            {
+            self->MrroRdsDataRTplus( ERTplusItemArtist, artistNames[self->iRtIterator-1] );
+            }
+        }
+    self->iRtPlusIterator++;
+        
+    return KErrNone;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/group/bld.inf	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,20 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "../utils/group/bld.inf"
+#include "../settings/group/bld.inf"
+#include "../engine/group/bld.inf"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/group/buildflags.hrh	Fri Jun 04 10:21:36 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:
+*
+*/
+
+
+#ifndef BUILDFLAGS_HRH_
+#define BUILDFLAGS_HRH_
+
+#ifdef __WINS__
+//#   define __FEATURE_RDS_SIMULATOR
+#endif
+
+#endif // BUILDFLAGS_HRH_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/settings/api/cradioregion.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,126 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef CRADIOREGION_H
+#define CRADIOREGION_H
+
+
+// System includes
+#include <e32base.h>
+
+// User includes
+#include "radioengine.hrh"
+
+// Forward declarations
+class CRadioRegion;
+class TResourceReader;
+
+// Data types
+typedef RPointerArray<CRadioRegion> RRadioRegionArray;
+typedef RPointerArray<HBufC16> RRadioCountryCodeArray;
+
+// Class declaration
+
+/**
+*  Class CRadioRegion provides information about FM region
+*/
+NONSHARABLE_CLASS( CRadioRegion ) : public CBase
+    {
+public:
+
+    static CRadioRegion* NewL( TResourceReader& aRr );
+
+    ~CRadioRegion();
+
+// New methods
+
+    /**
+    * Id Get the id of region
+    * @return id of region
+    */
+    IMPORT_C TRadioRegion Id() const;
+
+    /**
+    * StepSize Get the step interval of region
+    * @return Step size
+    */
+    IMPORT_C TUint32 StepSize() const;
+
+    /**
+    * Get the minimum frequency of region
+    * @return Minimum frequency
+    */
+    IMPORT_C TUint32 MinFrequency() const;
+
+    /**
+    * Get the maximum frequency of region
+    * @return Maximum frequency
+    */
+    IMPORT_C TUint32 MaxFrequency() const;
+
+    /**
+    * Get the decimal count of region.
+    * @return Decimal count.
+    */
+    IMPORT_C TInt DecimalCount() const;
+
+    /**
+    * CountryCode Get the country code of region
+    * @return Country code, or empty descriptor if country code doesn't exist
+    */
+    IMPORT_C const RRadioCountryCodeArray& CountryCodes();
+
+    /**
+    * Name Get the name of region
+    * @return Name of region
+    */
+    IMPORT_C const TDesC16& Name() const;
+
+    /**
+    * SettingItemName Get the name of region for setting item
+    * @return Name of region
+    */
+    IMPORT_C const TDesC16& SettingItemName() const;
+
+private:
+
+    CRadioRegion();
+
+    void ConstructL( TResourceReader& aRr );
+
+private: // data
+    
+    /** Id of the region*/
+    TRadioRegion            iId;
+    /** Step interval*/
+    TUint16                 iStepSize;
+    /** Min frequency */
+    TUint32                 iMinFreq;
+    /** Max frequency */
+    TUint32                 iMaxFreq;
+    /** Decimal count */
+    TInt                    iDecimalCount;
+    /** Country code*/
+    RRadioCountryCodeArray  iCountryCodes;
+    /** Region name*/
+    HBufC*                  iName;
+    /** Region name for setting item*/
+    HBufC*                  iSettingName;
+
+    };
+
+#endif // CRADIOREGION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/settings/api/cradiosettings.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,96 @@
+/*
+* 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 C_RADIOSETTINGS_H
+#define C_RADIOSETTINGS_H
+
+// System includes
+#include <e32base.h>
+
+// User includes
+#include "radioengine.hrh"
+
+// Forward declarations
+class CCoeEnv;
+class MRadioApplicationSettings;
+class MRadioEngineSettings;
+class MRadioSettingsSetter;
+class CRadioRepositoryManager;
+class MRadioPresetSettings;
+class RFs;
+
+/**
+ * Manages persistent application settings.
+ *
+ * Exposes access to the underlying settings implementations.
+ */
+NONSHARABLE_CLASS( CRadioSettings ) : public CBase
+    {
+
+public:
+
+    IMPORT_C static CRadioSettings* NewL( CCoeEnv* aCoeEnv = NULL );
+
+    IMPORT_C virtual ~CRadioSettings();
+
+    /**
+     * Determines if region is allowed.
+     */
+    virtual TBool IsRegionAllowed( TRadioRegion aRegionId ) const = 0;
+
+    /**
+     * Returns the implemented application settings interface.
+     *
+     * @return  The implemented application settings interface.
+     */
+    virtual MRadioApplicationSettings& ApplicationSettings() const = 0;
+
+    /**
+     * Returns the implemented radio settings interface.
+     *
+     * @return  The implemented radio settings interface.
+     */
+    virtual MRadioEngineSettings& EngineSettings() const = 0;
+
+    /**
+     * Returns the implemented radio settings interface.
+     *
+     * @return  The implemented setter interface for radio settings.
+     */
+    virtual MRadioSettingsSetter& RadioSetter() const = 0;
+
+    /**
+     * Returns the repository manager.
+     *
+     * @return  The repository manager.
+     */
+    virtual CRadioRepositoryManager& Repository() const = 0;
+
+    /**
+     * Resolves the most recently updated location for a file.
+     *
+     * @param   aFileName      The file name to be searched.
+     *                         On return, will contain the full path to the file.
+     * @param   aPath          The absolute path to the file. If drive letter is
+     *                         given then that one will be first tried.
+     */
+    virtual void ResolveDriveL( TFileName& aFileName, const TDesC& aPath ) = 0;
+
+    };
+
+#endif // C_RADIOSETTINGS_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/settings/api/mradioapplicationsettings.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef M_RADIOAPPLICATIONSETTINGS_H
+#define M_RADIOAPPLICATIONSETTINGS_H
+
+#include <badesca.h>
+
+/**
+ * MRadioApplicationSettings
+ *
+ * Interface for managing persistent Visual Radio application settings.
+ */
+NONSHARABLE_CLASS( MRadioApplicationSettings )
+    {
+
+public:
+
+    /**
+     * Possible states for audio playing state.
+     * Once the state reaches ´played´, it doesn't change.
+     */
+    enum TRadioCRAudioPlayHistory
+        {
+        ERadioCRInitial,
+        ERadioCRAudioTriggered,
+        ERadioCRAudioPlayed
+        };
+
+public:
+
+    /**
+     * Stores the currently active preset in the preset list.
+     *
+     * @param aIndex The list box index of the preset that is
+     * currently active.
+     */
+    virtual TInt SetActiveFocusLocation( TInt aIndex ) = 0;
+
+    /**
+     * Retrieves the list box index of the currently active preset.
+     * By default, the first preset is active.
+     *
+     * @return The list box index of the currently active preset.
+     */
+    virtual TInt ActiveFocusLocation() const = 0;
+
+    /**
+     * Stores the audio history telling whether the audio has been
+     * played ( so that user has triggered it ).
+     *
+     * Once the history reaches state 'played', it does not change.
+     *
+     * @param aHistory The audio history.
+     */
+    virtual void SetAudioPlayHistoryL( TRadioCRAudioPlayHistory aHistory ) = 0;
+
+    /**
+     * Retrieves the current audio play history.
+     *
+     * @return The current audio play history.
+     */
+    virtual TRadioCRAudioPlayHistory AudioPlayHistory() const = 0;
+
+    virtual TInt UpdateStartCount() = 0;
+
+    virtual TInt SetUiFlags( TUint aUiFlags ) = 0;
+
+    virtual TUint UiFlags() const = 0;
+
+    };
+
+#endif // M_RADIOAPPLICATIONSETTINGS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/settings/api/mradioenginesettings.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,200 @@
+/*
+* 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 M_RADIOSETTINGS_H
+#define M_RADIOSETTINGS_H
+
+// System includes
+#include <e32def.h>
+
+// User includes
+#include "radioengine.hrh"
+
+// Forward declarations
+class CRadioRegion;
+
+/**
+ * Interface for managing persistent Visual Radio application FM radio specific settings.
+ */
+NONSHARABLE_CLASS( MRadioEngineSettings )
+    {
+
+public:
+
+    /**
+     * Retrieves the radio volume level that is used when audio is routed through the headset.
+     *
+     * @return   The radio volume level.
+     */
+    virtual TInt HeadsetVolume() const = 0;
+
+    /**
+     * Retrieves the radio volume level that is used when audio is routed through the speaker.
+     *
+     * @return  The radio volume level.
+     */
+    virtual TInt SpeakerVolume() const = 0;
+
+    /**
+     * Wrapper for retrieving the radio volume level of current output device
+     *
+     * @return  The radio volume level.
+     */
+    virtual TInt Volume() const = 0;
+
+    /**
+     * Retrieves the radio output mode currently in use.
+     *
+     * @return  The radio output mode currently in use.
+     */
+    virtual TInt OutputMode() const = 0;
+
+    /**
+     * Retrieves the radio audio route in use.
+     *
+     * @return  The radio audio route in use.
+     */
+    virtual TInt AudioRoute() const = 0;
+
+    /**
+     * Retrieves the muting state of radio when audio is routed through the headset.
+     *
+     * @return  <code>ETrue</code> if radio audio is muted when routed through the headset, <code>EFalse</code> otherwise.
+     */
+    virtual TBool IsHeadsetVolMuted() const = 0;
+
+    /**
+     * Retrieves the muting state of radio when audio is routed through the speaker.
+     *
+     * @return  <code>ETrue</code> if radio audio is muted when routed through the speaker, <code>EFalse</code> otherwise.
+     */
+    virtual TBool IsSpeakerVolMuted() const = 0;
+
+    /**
+     * Wrapper for retrieving the muting state of current output device
+     *
+     * @return  <code>ETrue</code> if radio audio is muted, <code>EFalse</code> otherwise.
+     */
+    virtual TBool IsVolMuted() const = 0;
+
+    /**
+     * Retrieves the power state of the radio.
+     *
+     * @return  <code>ETrue</code> if the radio is powered on, <code>EFalse</code> otherwise.
+     */
+    virtual TBool IsPowerOn() const = 0;
+
+    /**
+     * Retrieves the currently tuned frequency.
+     *
+     * @return  The currently tuned frequency.
+     */
+    virtual TUint32 TunedFrequency() const = 0;
+
+    /**
+     * Retrieves the default minimum volume level.
+     *
+     * @return  The default minimum volume level.
+     */
+    virtual TInt DefaultMinVolumeLevel() const = 0;
+
+    /**
+     * Retrieves the number of regions defined.
+     *
+     * @return  The number of regions defined.
+     */
+    virtual TInt CountRegions() const = 0;
+
+    /**
+     * Retrieves a region matching the supplied index.
+     *
+     * @param   aIndex  The index of the region.
+     * @return  The region matching the supplied index.
+     */
+    virtual CRadioRegion& Region( TInt aIndex ) const = 0;
+
+    /**
+     * Retrieves the current region's ID.
+     *
+     * @return  The region's ID.
+     */
+    virtual TRadioRegion RegionId() const = 0;
+
+    /**
+     * Retrieves the frequency step size for the current region.
+     *
+     * @return  The frequency step size for the current region.
+     */
+    virtual TUint32 FrequencyStepSize() const = 0;
+
+    /**
+     * Retrieves the maximum frequency for the current region.
+     * If region switching is ongoing, this might be zero.
+     *
+     * @return  The maximum freqency for the current region.
+     */
+    virtual TUint32 MaxFrequency() const = 0;
+
+    /**
+     * Retrieves the minimum frequency for the current region.
+     * If region switching is ongoing, this might be zero.
+     *
+     * @return  The minimum freqency for the current region.
+     */
+    virtual TUint32 MinFrequency() const = 0;
+
+    /**
+     * Retrieves the frequency decimal count of the current region.
+     *
+     * @return Decimal count.
+     */
+    virtual TInt DecimalCount() const = 0;
+
+    /**
+     * Retrieves the RDS alternate frequency search setting
+     *
+     * @return ETrue if AF search is enabled, otherwise EFalse
+     */
+    virtual TBool RdsAfSearchEnabled() const = 0;
+
+    /**
+     * Retrieves the default region's ID.
+     *
+     * @return  The region's ID.
+     */
+    virtual TRadioRegion DefaultRegion() const = 0;
+
+    /**
+     *
+     */
+    virtual TPtrC NetworkId() const = 0;
+
+    /**
+     *
+     */
+    virtual TPtrC SubscriberId() const = 0;
+
+    /**
+     *
+     */
+    virtual TPtrC CountryCode() const = 0;
+
+    };
+
+#endif // M_RADIOSETTINGS_H
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/settings/api/mradiosettingsobserver.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef M_RADIOSETTINGSOBSERVER_H
+#define M_RADIOSETTINGSOBSERVER_H
+
+
+/**
+ * Interface for observing some radio related settings.
+ * This interface is intended for the use of radio to update it's internal state
+ * to conform to newly changed setting
+ */
+NONSHARABLE_CLASS( MRadioSettingsObserver )
+    {
+public:
+
+    /**
+     * Notifies of the change in RDS alternate frequency setting
+     *
+     * @param aEnabled ETrue if AF search is enabled, otherwise EFalse
+     */
+    virtual void RdsAfSearchSettingChangedL( TBool aEnabled ) = 0;
+
+    /**
+     * Notifies of the change in region setting when it is changed
+     * outside of the particular radio settings instance
+     *
+     * @param aRegion The new region ID
+     */
+    virtual void RegionSettingChangedL( TInt aRegion ) = 0;
+
+    };
+
+#endif // M_RADIOSETTINGSOBSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/settings/api/mradiosettingssetter.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,143 @@
+/*
+* 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 M_RADIOSETTINGSSETTERS_H
+#define M_RADIOSETTINGSSETTERS_H
+
+// User includes
+#include "mradioenginesettings.h"
+
+// Forward declarations
+class MRadioSettingsObserver;
+
+/**
+ * Setter interface for radio settings. This should be accessible only for CRadioEngineImp
+ */
+NONSHARABLE_CLASS( MRadioSettingsSetter ) : public MRadioEngineSettings
+    {
+public:
+
+    /**
+     * Sets observer for the radio settings
+     *
+     * @param aObserver The observer
+     */
+    virtual void SetObserver( MRadioSettingsObserver* aObserver ) = 0;
+
+    /**
+     * Stores the radio volume level that is used when audio is routed through the headset.
+     *
+     * @param    aVolume     The radio volume level to store.
+     *
+     */
+    virtual TInt SetHeadsetVolume( TInt aVolume ) = 0;
+
+    /**
+     * Stores the radio volume level that is used when audio is routed through the speaker.
+     *
+     * @param   aVolume     The radio volume level.
+     */
+    virtual TInt SetSpeakerVolume( TInt aVolume ) = 0;
+
+    /**
+     * Wrapper for storing the radio volume level of current output device
+     *
+     * @param   aVolume     The radio volume level.
+     */
+    virtual TInt SetVolume( TInt aVolume ) = 0;
+
+    /**
+     * Stores the radio output mode to use.
+     *
+     * @param   aOutputMode     The radio output mode to use.
+     */
+    virtual TInt SetOutputMode( TInt aOutputMode ) = 0;
+
+    /**
+     * Stores the radio audio route ( headset/ihf ) to use.
+     *
+     * @param   aAudioRoute   The radio output destination to use.
+     */
+    virtual TInt SetAudioRoute( TInt aAudioRoute ) = 0;
+
+    /**
+     * Stores the radio muting state when audio is routed through the headset.
+     *
+     * @param   aMuted      <code>ETrue</code> if radio is to be muted when routed through the headset, <code>EFalse</code> otherwise.
+     */
+    virtual TInt SetHeadsetVolMuted( TBool aMuted ) = 0;
+
+    /**
+     * Stores the radio muting state when audio is routed through the speaker.
+     *
+     * @param   aMuted      <code>ETrue</code> if radio is to be muted when routed through the speaker, <code>EFalse</code> otherwise.
+     */
+    virtual TInt SetSpeakerVolMuted( TBool aMuted ) = 0;
+
+    /**
+     * Wrapper for storing the radio muting state of current output device
+     *
+     * @param   aMuted      <code>ETrue</code> if radio is to be muted, <code>EFalse</code> otherwise.
+     */
+    virtual TInt SetVolMuted( TBool aMuted ) = 0;
+
+    /**
+     * Stores the power state of the radio.
+     *
+     * @param   aPowerState     <code>ETrue</code> if radio is powered on, <code>EFalse</code> otherwise.
+     */
+    virtual TInt SetPowerOn( TBool aPowerState ) = 0;
+
+    /**
+     * Stores the frequency tuned.
+     *
+     * @param   aFrequency  The frequency to store.
+     */
+    virtual TInt SetTunedFrequency( TUint32 aFrequency ) = 0;
+
+    /**
+     * Stores the region ID currently in use.
+     *
+     * @param   aRegion     The region's ID to store.
+     */
+    virtual TInt SetRegionId( TInt aRegion ) = 0;
+
+    /**
+     * Stores the RDS alternate frequency search setting
+     *
+     * @param aEnabled ETrue if search is enabled, otherwise EFalse
+     */
+    virtual TInt SetRdsAfSearch( TBool aEnabled ) = 0;
+
+    /**
+     *
+     */
+    virtual TInt SetNetworkId( const TDesC& aNetworkId ) = 0;
+
+    /**
+     *
+     */
+    virtual TInt SetSubscriberId( const TDesC& aSubscriberId ) = 0;
+
+    /**
+     *
+     */
+    virtual TInt SetCountryCode( const TDesC& aCountryCode ) = 0;
+
+    };
+
+#endif // M_RADIOSETTINGSSETTERS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/settings/bwins/radioenginesettingsu.def	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,12 @@
+EXPORTS
+	??1CRadioSettings@@UAE@XZ @ 1 NONAME ; CRadioSettings::~CRadioSettings(void)
+	?CountryCodes@CRadioRegion@@QAEABV?$RPointerArray@VHBufC16@@@@XZ @ 2 NONAME ; class RPointerArray<class HBufC16> const & CRadioRegion::CountryCodes(void)
+	?DecimalCount@CRadioRegion@@QBEHXZ @ 3 NONAME ; int CRadioRegion::DecimalCount(void) const
+	?Id@CRadioRegion@@QBE?AW4TRadioRegion@@XZ @ 4 NONAME ; enum TRadioRegion CRadioRegion::Id(void) const
+	?MaxFrequency@CRadioRegion@@QBEKXZ @ 5 NONAME ; unsigned long CRadioRegion::MaxFrequency(void) const
+	?MinFrequency@CRadioRegion@@QBEKXZ @ 6 NONAME ; unsigned long CRadioRegion::MinFrequency(void) const
+	?Name@CRadioRegion@@QBEABVTDesC16@@XZ @ 7 NONAME ; class TDesC16 const & CRadioRegion::Name(void) const
+	?NewL@CRadioSettings@@SAPAV1@PAVCCoeEnv@@@Z @ 8 NONAME ; class CRadioSettings * CRadioSettings::NewL(class CCoeEnv *)
+	?SettingItemName@CRadioRegion@@QBEABVTDesC16@@XZ @ 9 NONAME ; class TDesC16 const & CRadioRegion::SettingItemName(void) const
+	?StepSize@CRadioRegion@@QBEKXZ @ 10 NONAME ; unsigned long CRadioRegion::StepSize(void) const
+
Binary file radioengine/settings/cenrep/101FF976.txt has changed
Binary file radioengine/settings/cenrep/keys_radioengine.xls has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/settings/data/radioenginesettings.rss	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,212 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// Resource identifier
+NAME    QRST
+
+// System includes
+#include <uikon.rh>
+
+#include "radiosettings.rh"
+#include "radiopreset.hrh"
+#include "radioengine.hrh"
+
+// Resource definitions
+
+// ---------------------------------------------------------
+//    Resource signature
+// ---------------------------------------------------------
+//
+
+RESOURCE RSS_SIGNATURE { }
+
+// Non-operator customisable settings
+
+// ---------------------------------------------------------
+//    r_qrad_empty_name_preset
+//    TBUF16 stores the string name for the empty "Empty"
+// ---------------------------------------------------------
+//
+RESOURCE TBUF256 r_qrad_empty_name_preset
+{
+    buf = qtn_radio_ch_empty;
+}
+
+// ---------------------------------------------------------
+//    r_qrad_predefined_presets
+//    Predefined presets list. No need to include empty presets -- they'll get autogenerated!
+// ---------------------------------------------------------
+//
+// The following array must coexist as the VERY LAST Resource IN THIS FILE, to maintain BC!
+RESOURCE RADIOPRESET r_qrad_empty_presets
+{
+    name = "";
+    freq_kHz = 0;
+    serviceid = "";
+    radio_preset_type = ERadioPresetItemEmpty;
+    radio_preset_location = "";
+}
+
+// ---------------------------------------------------------
+//
+// ---------------------------------------------------------
+//
+STRUCT RADIO_REGION
+    {
+    WORD id;
+    WORD stepsize;
+    LONG minfrequency;
+    LONG maxfrequency;
+    WORD decimalcount;
+    LTEXT countrycodes[] = {""};
+    LTEXT regionname;
+    LTEXT regionsettingname;
+    }
+
+// ---------------------------------------------------------
+//
+// ---------------------------------------------------------
+//
+STRUCT RADIO_REGION_ARRAY
+    {
+    LLINK regions[];
+    }
+
+// ---------------------------------------------------------
+//    r_qrad_regions
+//    Array of the supported regions
+// ---------------------------------------------------------
+//
+RESOURCE RADIO_REGION_ARRAY r_qrad_regions
+    {
+    regions =
+        {
+        r_qrad_region_japan,
+        r_qrad_region_america,
+        r_qrad_region_default
+        };
+    }
+
+// ---------------------------------------------------------
+//    r_qrad_region_japan
+//    Region settings for Japan
+//    Check country codes from:
+//    "COMPLEMENT TO ITU-T RECOMMENDATION E.212, LIST OF MOBILE COUNTRY OR GEOGRAPHICAL AREA CODES"
+// ---------------------------------------------------------
+//
+RESOURCE RADIO_REGION r_qrad_region_japan
+    {
+    id = ERadioRegionJapan;
+    stepsize = 100;
+    minfrequency = 76000;
+    maxfrequency = 90000;
+    decimalcount = 1;
+    countrycodes =
+        {
+        "440",
+        "441"
+        };
+    regionname = qtn_vr_reg_japan;
+    regionsettingname = qtn_vr_set_reg_japan;
+    }
+
+// ---------------------------------------------------------
+//    r_qrad_region_america
+//    Region settings for America
+//    "COMPLEMENT TO ITU-T RECOMMENDATION E.212, LIST OF MOBILE COUNTRY OR GEOGRAPHICAL AREA CODES"
+// ---------------------------------------------------------
+//
+RESOURCE RADIO_REGION r_qrad_region_america
+    {
+    id = ERadioRegionAmerica;
+    stepsize = 200;
+    minfrequency = 88100;
+    maxfrequency = 107900;
+    decimalcount = 1;
+    countrycodes =
+        {
+        "302",  // Canada
+        "310",  // USA
+        "311",  // USA
+        "312",  // USA
+        "313",  // USA
+        "314",  // USA
+        "315",  // USA
+        "316",  // USA
+        "332",  // United States Virgin Islands
+        "334",  // Mexico
+        "338",  // Jamaica
+        "342",  // Barbados
+        "344",  // Antigua and Barbuda
+        "352",  // Grenada
+        "360",  // Saint Vincent and the Grenadines
+        "364",  // Bahamas
+        "366",  // Common Wealth of Dominica
+        "370",  // Dominican Republic
+        "372",  // Haiti
+        "374",  // Trinidad and Tobago
+        "368",  // Cuba
+        "702",  // Belize
+        "704",  // Guatemala
+        "706",  // El Salvador
+        "708",  // Honduras
+        "710",  // Nicaragua
+        "712",  // Costa Rica
+        "714",  // Panama
+        "716",  // Peru
+        "722",  // Argentina
+        "724",  // Brazil
+        "730",  // Chile
+        "732",  // Colombia
+        "734",  // Venezuela
+        "736",  // Bolivia
+        "738",  // Guyana
+        "740",  // Ecuador
+        "744",  // Paraguay
+        "746",  // Suriname
+        "748"   // Uruguay
+        };
+    regionname = qtn_vr_reg_america;
+    regionsettingname = qtn_vr_set_reg_america;
+    }
+
+// ---------------------------------------------------------
+//    r_qrad_region_default
+//    Region settings for default region
+// ---------------------------------------------------------
+//
+RESOURCE RADIO_REGION r_qrad_region_default
+    {
+    id = ERadioRegionDefault;
+    stepsize = 50;
+    minfrequency = 87500;
+    maxfrequency = 108000;
+    decimalcount = 2;
+    regionname = qtn_vr_reg_other;
+    regionsettingname = qtn_vr_set_reg_other;
+    }
+
+// ---------------------------------------------------------
+//    r_qtn_qrad_folder_radio_presets
+//    TBUF32 stores the string for presets folder name
+//    String lenght must be 30 characters
+// ---------------------------------------------------------
+//
+RESOURCE TBUF32 r_qtn_qrad_folder_radio_presets
+    {
+    buf = qtn_vr_folder_radio_presets;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/settings/eabi/radioenginesettingsu.def	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,14 @@
+EXPORTS
+	_ZN12CRadioRegion12CountryCodesEv @ 1 NONAME
+	_ZN14CRadioSettings4NewLEP7CCoeEnv @ 2 NONAME
+	_ZN14CRadioSettingsD0Ev @ 3 NONAME
+	_ZN14CRadioSettingsD1Ev @ 4 NONAME
+	_ZN14CRadioSettingsD2Ev @ 5 NONAME
+	_ZNK12CRadioRegion12DecimalCountEv @ 6 NONAME
+	_ZNK12CRadioRegion12MaxFrequencyEv @ 7 NONAME
+	_ZNK12CRadioRegion12MinFrequencyEv @ 8 NONAME
+	_ZNK12CRadioRegion15SettingItemNameEv @ 9 NONAME
+	_ZNK12CRadioRegion2IdEv @ 10 NONAME
+	_ZNK12CRadioRegion4NameEv @ 11 NONAME
+	_ZNK12CRadioRegion8StepSizeEv @ 12 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/settings/group/backup_registration.xml	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,7 @@
+<?xml version="1.0" standalone="yes"?>
+<backup_registration version="1.0">
+  <passive_backup>
+  </passive_backup>
+  <proxy_data_manager sid="0x10202BE9"/>
+  <restore requires_reboot = "no"/>
+</backup_registration>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/settings/group/bld.inf	Fri Jun 04 10:21:36 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:
+*
+*/
+
+#include "../../group/buildflags.hrh"
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+WINSCW ARMV5
+
+PRJ_EXPORTS
+
+//../sis/visualradiostub.sis /epoc32/data/z/system/install/visualradio.sis
+backup_registration.xml /epoc32/data/z/private/101ff976/backup_registration.xml
+
+../cenrep/101FF976.txt  /epoc32/data/z/private/10202be9/101FF976.txt
+../cenrep/101FF976.txt  /epoc32/RELEASE/winscw/UDEB/Z/private/10202be9/101FF976.txt
+../cenrep/101FF976.txt  /epoc32/RELEASE/winscw/UREL/Z/private/10202be9/101FF976.txt
+
+PRJ_MMPFILES
+radioenginesettings.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/settings/group/radioenginesettings.mmp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include "../../group/buildflags.hrh"
+
+#include <platform_paths.hrh>
+
+#include <data_caging_paths.hrh>
+
+#include                <data_caging_paths.hrh>
+
+TARGET                  radioenginesettings.dll
+TARGETTYPE              DLL
+UID                     0x1000008D 0x101FF94C
+VERSION                 10.0
+
+CAPABILITY              CAP_GENERAL_DLL
+VENDORID                VID_DEFAULT
+PAGED
+//LANGUAGE_IDS
+LANG SC
+
+SOURCEPATH              ../data
+START RESOURCE          radioenginesettings.rss
+HEADER
+TARGETPATH              RESOURCE_FILES_DIR
+END // RESOURCE
+
+USERINCLUDE             ../api
+USERINCLUDE             ../inc
+USERINCLUDE             ../../utils/api
+
+APP_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH              ../src
+SOURCE                  cradioregion.cpp
+SOURCE                  cradiosettings.cpp
+SOURCE                  cradiosettingsimp.cpp
+SOURCE                  cradiosettingsbase.cpp
+SOURCE                  cradioenginesettings.cpp
+SOURCE                  cradioapplicationsettings.cpp
+
+LIBRARY                 radioengineutils.lib
+LIBRARY                 bafl.lib
+LIBRARY                 commonengine.lib
+LIBRARY                 cone.lib
+LIBRARY                 efsrv.lib
+LIBRARY                 estor.lib
+LIBRARY                 euser.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/settings/inc/cradioapplicationsettings.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef C_RADIOAPPLICATIONSETTINGS_H
+#define C_RADIOAPPLICATIONSETTINGS_H
+
+// User includes
+#include "mradioapplicationsettings.h"
+#include "cradiosettingsbase.h"
+
+/**
+ * Concrete implementation of application settings.
+ */
+NONSHARABLE_CLASS( CRadioApplicationSettings ) : public CRadioSettingsBase
+                                               , public MRadioApplicationSettings
+    {
+
+public:
+
+    static CRadioApplicationSettings* NewL( CRadioRepositoryManager& aRepositoryManager, CCoeEnv& aCoeEnv );
+
+    ~CRadioApplicationSettings();
+
+// from base class MRadioApplicationSettings
+
+    TInt SetActiveFocusLocation( TInt aIndex );
+    TInt ActiveFocusLocation() const;
+    void SetAudioPlayHistoryL( TRadioCRAudioPlayHistory aHistory );
+    TRadioCRAudioPlayHistory AudioPlayHistory() const;
+    TInt UpdateStartCount();
+    TInt SetUiFlags( TUint aUiFlags );
+    TUint UiFlags() const;
+
+private:
+
+    CRadioApplicationSettings( CRadioRepositoryManager& aRepositoryManager, CCoeEnv& aCoeEnv );
+
+    void ConstructL();
+
+    };
+
+#endif // C_RADIOAPPLICATIONSETTINGS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/settings/inc/cradioenginesettings.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,150 @@
+/*
+* 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 C_RADIOENGINESETTINGS_H
+#define C_RADIOENGINESETTINGS_H
+
+// User includes
+#include "mradioenginesettings.h"
+#include "mradiosettingssetter.h"
+#include "cradioregion.h"
+#include "mradiorepositoryentityobserver.h"
+#include "cradiosettingsbase.h"
+
+// Forward declarations
+class MRadioSettingsObserver;
+
+/**
+ * Concrete implementation of radio settings.
+ */
+NONSHARABLE_CLASS( CRadioEngineSettings ) : public CRadioSettingsBase
+                                          , public MRadioSettingsSetter
+                                          , public MRadioRepositoryEntityObserver
+    {
+
+public:
+
+    static CRadioEngineSettings* NewL( CRadioRepositoryManager& aRepositoryManager, CCoeEnv& aCoeEnv );
+
+    ~CRadioEngineSettings();
+
+    /**
+     * Determines if region is allowed.
+     */
+    TBool IsRegionAllowed( TRadioRegion aRegionId ) const;
+
+private:
+
+    CRadioEngineSettings( CRadioRepositoryManager& aRepositoryManager, CCoeEnv& aCoeEnv );
+
+    void ConstructL();
+
+// from base class MRadioEngineSettings
+
+    TInt HeadsetVolume() const;
+    TInt SpeakerVolume() const;
+    TInt Volume() const;
+    TInt OutputMode() const;
+    TInt AudioRoute() const;
+    TBool IsHeadsetVolMuted() const;
+    TBool IsSpeakerVolMuted() const;
+    TBool IsVolMuted() const;
+    TBool IsPowerOn() const;
+    TUint32 TunedFrequency() const;
+    TInt DefaultMinVolumeLevel() const;
+    TInt CountRegions() const;
+    CRadioRegion& Region( TInt aIndex ) const;
+    TRadioRegion RegionId() const;
+    TUint32 FrequencyStepSize() const;
+    TUint32 MaxFrequency() const;
+    TUint32 MinFrequency() const;
+    TInt DecimalCount() const;
+    TBool RdsAfSearchEnabled() const;
+    TRadioRegion DefaultRegion() const;
+    TPtrC NetworkId() const;
+    TPtrC SubscriberId() const;
+    TPtrC CountryCode() const;
+
+// from base class MRadioSettingsSetter
+
+    void SetObserver( MRadioSettingsObserver* aObserver );
+    TInt SetHeadsetVolume( TInt aVolume );
+    TInt SetSpeakerVolume( TInt aVolume );
+    TInt SetVolume( TInt aVolume );
+    TInt SetOutputMode( TInt aOutputMode );
+    TInt SetAudioRoute( TInt aAudioRoute );
+    TInt SetHeadsetVolMuted( TBool aMuted );
+    TInt SetSpeakerVolMuted( TBool aMuted );
+    TInt SetVolMuted( TBool aMuted );
+    TInt SetPowerOn( TBool aPowerState );
+    TInt SetTunedFrequency( TUint32 aFrequency );
+    TInt SetRegionId( TInt aRegion );
+    TInt SetRdsAfSearch( TBool aEnabled );
+    TInt SetNetworkId( const TDesC& aNetworkId );
+    TInt SetSubscriberId( const TDesC& aSubscriberId );
+    TInt SetCountryCode( const TDesC& aCountryCode );
+
+// from base class MRadioRepositoryEntityObserver
+
+    void HandleRepositoryValueChangeL( const TUid& aUid, TUint32 aKey, TInt aValue, TInt aError );
+    void HandleRepositoryValueChangeL( const TUid& /*aUid*/, TUint32 /*aKey*/, const TReal& /*aValue*/, TInt /*aError*/ ) {}
+    void HandleRepositoryValueChangeL( const TUid& /*aUid*/, TUint32 /*aKey*/, const TDesC8& /*aValue*/, TInt /*aError*/ ) {}
+    void HandleRepositoryValueChangeL( const TUid& /*aUid*/, TUint32 /*aKey*/, const TDesC16& /*aValue*/, TInt /*aError*/ ) {}
+
+// New functions
+
+    /**
+     * Initializes the regions as defined in the resource file.
+     */
+    void InitializeRegionsL();
+
+    /**
+     * Converts Region ID to index
+     *
+     * @param aRegionId The region ID that is wanted to convert
+     * @return The region index, KErrNotFound if no match found
+     */
+    TInt RegionIndexForId( TInt aRegionId ) const;
+
+    /**
+     * Updates the current region index
+     *
+     * @param aRegionId The new region ID
+     */
+     void UpdateCurrentRegionIdx( TInt aRegionId );
+
+private: // data
+
+    /**
+     * The observer for the setting changes.
+     * Not own.
+     */
+    MRadioSettingsObserver* iObserver;
+
+    /**
+     * The available regions.
+     */
+    RRadioRegionArray       iRegions;
+
+    /**
+     * The current region.
+     */
+    TInt                    iCurrentRegionIdx;
+
+    };
+
+#endif // C_RADIOENGINESETTINGS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/settings/inc/cradiosettingsbase.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,77 @@
+/*
+* 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 C_RADIOSETTINGSBASE_H
+#define C_RADIOSETTINGSBASE_H
+
+// System includes
+#include <badesca.h>
+#include <e32base.h>
+
+// Forward declarations
+class CCoeEnv;
+class CRadioRepositoryManager;
+
+/**
+ * Base class for all settings implementations.
+ *
+ * Provides commonly used data members and methods.
+ */
+NONSHARABLE_CLASS( CRadioSettingsBase ) : public CBase
+    {
+
+public:
+
+    ~CRadioSettingsBase();
+
+protected:
+
+    CRadioSettingsBase( CRadioRepositoryManager& aRepositoryManager, CCoeEnv& aCoeEnv );
+
+    /**
+     * Writes an array to the repository.
+     *
+     * @param   aUid        The UID of the repository.
+     * @param   aKey        The key to which to write the array.
+     * @param   aArray      The array to write.
+     */
+    void WriteArrayEntityL( const TUid& aUid, TUint32 aKey, const CDesCArray& aArray );
+
+    /**
+     * Reads an array from the repository.
+     *
+     * @param   aUid        The UID of the repository.
+     * @param   aKey        The key to which to write the array.
+     * @return  The array that was read. Ownership is transferred to the caller.
+     */
+    CDesCArray* ReadArrayEntityL( const TUid& aUid, TUint32 aKey ) const;
+
+protected:
+
+    /**
+     * The control environment.
+     */
+    CCoeEnv&                    iCoeEnv;
+
+    /**
+     * The repository manager.
+     */
+    CRadioRepositoryManager&    iRepositoryManager;
+
+    };
+
+#endif // C_RADIOSETTINGSBASE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/settings/inc/cradiosettingsimp.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef C_RADIOSETTINGSIMP_H
+#define C_RADIOSETTINGSIMP_H
+
+// User includes
+#include "cradiosettings.h"
+
+// Forward declarations
+class CCoeEnv;
+class CRadioApplicationSettings;
+class CRadioEngineSettings;
+class CRadioRepositoryManager;
+class RConeResourceLoader;
+
+/**
+ * Manages persistent application settings.
+ *
+ * Exposes access to the underlying settings implementations.
+ */
+NONSHARABLE_CLASS( CRadioSettingsImp ) : public CRadioSettings
+    {
+
+public:
+
+    static CRadioSettingsImp* NewL( CCoeEnv* aCoeEnv = NULL );
+
+    ~CRadioSettingsImp();
+
+// from base class CRadioSettings
+
+    TBool IsRegionAllowed( TRadioRegion aRegionId ) const;
+    MRadioApplicationSettings& ApplicationSettings() const;
+    MRadioEngineSettings& EngineSettings() const;
+    MRadioSettingsSetter& RadioSetter() const;
+    CRadioRepositoryManager& Repository() const;
+    void ResolveDriveL( TFileName& aFileName, const TDesC& aPath );
+
+private:
+
+    CRadioSettingsImp();
+
+    void ConstructL( CCoeEnv* aCoeEnv );
+
+    /**
+     * Loads the resources required by the settings.
+     */
+    void LoadResourcesL();
+
+private: // data
+
+    /**
+     * The central repository manager.
+     * Own.
+     */
+    CRadioRepositoryManager*    iRepositoryManager;
+
+    /**
+     * Resource loader for the settings resources.
+     * Own.
+     */
+    RConeResourceLoader*        iResourceLoader;
+
+    /**
+     * Implementation of the application settings.
+     * Own
+     */
+    CRadioApplicationSettings*  iApplicationSettings;
+
+    /**
+     * Implementation of the radio settings.
+     * Own
+     */
+    CRadioEngineSettings*       iEngineSettings;
+
+    };
+
+#endif // C_RADIOSETTINGSIMP_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/settings/inc/radiopreset.hrh	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,33 @@
+/*
+* 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 RADIOPRESET_HRH
+#define RADIOPRESET_HRH
+
+#define KVRDefaultPresetFolder 0
+
+/**
+ * Preset types.
+ */
+enum TRadioPresetType
+    {
+    ERadioPresetItemEmpty = 0,                       /**< The preset item is empty, i.e. not initialized yet. */
+    ERadioPresetItemRadioContentEnabled = 1,         /**< The preset item has radio frequency. */
+    ERadioPresetItemVisualRadioContentEnabled = 2    /**< The preset item has visual content enabled. */
+    };
+
+#endif // RADIOPRESET_HRH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/settings/inc/radiosettings.rh	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,33 @@
+/*
+* 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 RADIOSETTINGS_RH
+#define RADIOSETTINGS_RH
+
+// System includes
+#include <uikon.rh>
+
+STRUCT RADIOPRESET
+{
+    LTEXT name;                     // Name of a Radio Station preset
+    LONG  freq_kHz;                 // Frequency of the radio, in kHz. 108.0 MHz == 108000 kHz
+    LTEXT serviceid;                // Visual Radio Service Id for Content server
+    BYTE  radio_preset_type;        // Indicates whether this is a visual radio -enabled preset. 0 indicates false, otherwise true.
+    LTEXT radio_preset_location;    // Location of the preset
+}
+
+#endif // RADIOSETTINGS_RH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/settings/src/cradioapplicationsettings.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,148 @@
+/*
+* 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:
+*
+*/
+
+// User includes
+#include "radiointernalcrkeys.h"
+#include "cradioapplicationsettings.h"
+#include "cradiorepositorymanager.h"
+#include "cradioenginelogger.h"
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioApplicationSettings* CRadioApplicationSettings::NewL( CRadioRepositoryManager& aRepositoryManager,
+                                                            CCoeEnv& aCoeEnv )
+    {
+    CRadioApplicationSettings* self = new ( ELeave ) CRadioApplicationSettings( aRepositoryManager, aCoeEnv );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioApplicationSettings::ConstructL()
+    {
+    iRepositoryManager.AddEntityL( KRadioCRUid, KRadioCRActiveFocusLocation, CRadioRepositoryManager::ERadioEntityInt );
+    iRepositoryManager.AddEntityL( KRadioCRUid, KRadioCRAudioPlayHistory, CRadioRepositoryManager::ERadioEntityInt );
+    iRepositoryManager.AddEntityL( KRadioCRUid, KRadioCRUiFlags, CRadioRepositoryManager::ERadioEntityInt );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioApplicationSettings::CRadioApplicationSettings( CRadioRepositoryManager& aRepositoryManager,
+                                                      CCoeEnv& aCoeEnv )
+    : CRadioSettingsBase( aRepositoryManager, aCoeEnv )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioApplicationSettings::~CRadioApplicationSettings()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioApplicationSettings.
+//
+// ---------------------------------------------------------------------------
+//
+TInt CRadioApplicationSettings::SetActiveFocusLocation( TInt aIndex )
+    {
+    return iRepositoryManager.SetEntityValue( KRadioCRUid, KRadioCRActiveFocusLocation, aIndex );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioApplicationSettings.
+//
+// ---------------------------------------------------------------------------
+//
+TInt CRadioApplicationSettings::ActiveFocusLocation() const
+    {
+    return iRepositoryManager.EntityValueInt( KRadioCRUid, KRadioCRActiveFocusLocation );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioApplicationSettings.
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioApplicationSettings::SetAudioPlayHistoryL( TRadioCRAudioPlayHistory aHistory )
+    {
+    if ( AudioPlayHistory() != ERadioCRAudioPlayed )
+        {
+        User::LeaveIfError( iRepositoryManager.SetEntityValue( KRadioCRUid, KRadioCRAudioPlayHistory, aHistory ) );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioApplicationSettings.
+//
+// ---------------------------------------------------------------------------
+//
+MRadioApplicationSettings::TRadioCRAudioPlayHistory CRadioApplicationSettings::AudioPlayHistory() const
+    {
+    return static_cast<TRadioCRAudioPlayHistory>(
+                    iRepositoryManager.EntityValueInt( KRadioCRUid, KRadioCRAudioPlayHistory ) );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioApplicationSettings.
+//
+// ---------------------------------------------------------------------------
+//
+TInt CRadioApplicationSettings::UpdateStartCount()
+    {
+    TInt startCount = 0;
+    TRAP_IGNORE
+        (
+        CRadioRepositoryManager::GetRepositoryValueL( KRadioCRUid, KRadioCRLaunchCount, startCount );
+        CRadioRepositoryManager::SetRepositoryValueL( KRadioCRUid, KRadioCRLaunchCount, startCount + 1 );
+        );
+    return startCount;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioApplicationSettings.
+//
+// ---------------------------------------------------------------------------
+//
+TInt CRadioApplicationSettings::SetUiFlags( TUint aUiFlags )
+    {
+    return iRepositoryManager.SetEntityValue( KRadioCRUid, KRadioCRUiFlags, static_cast<TInt>( aUiFlags ) );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioApplicationSettings.
+//
+// ---------------------------------------------------------------------------
+//
+TUint CRadioApplicationSettings::UiFlags() const
+    {
+    return static_cast<TUint>( iRepositoryManager.EntityValueInt( KRadioCRUid, KRadioCRUiFlags ) );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/settings/src/cradioenginesettings.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,669 @@
+/*
+* 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:
+*
+*/
+
+// System includes
+#include <barsread.h>
+#include <coemain.h>
+
+// User includes
+#include "radiointernalcrkeys.h"
+#include "radioenginesettings.rsg"
+#include "radioenginedef.h"
+#include "cradioenginesettings.h"
+#include "mradiosettingsobserver.h"
+#include "cradiorepositorymanager.h"
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioEngineSettings* CRadioEngineSettings::NewL( CRadioRepositoryManager& aRepositoryManager,
+                                                  CCoeEnv& aCoeEnv )
+    {
+    CRadioEngineSettings* self = new ( ELeave ) CRadioEngineSettings( aRepositoryManager, aCoeEnv );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineSettings::ConstructL()
+    {
+    iRepositoryManager.AddObserverL( this );
+    iRepositoryManager.AddEntityL( KRadioCRUid, KRadioCRHeadsetVolume,          CRadioRepositoryManager::ERadioEntityInt );
+    iRepositoryManager.AddEntityL( KRadioCRUid, KRadioCRSpeakerVolume,          CRadioRepositoryManager::ERadioEntityInt );
+    iRepositoryManager.AddEntityL( KRadioCRUid, KRadioCROutputMode,             CRadioRepositoryManager::ERadioEntityInt );
+    iRepositoryManager.AddEntityL( KRadioCRUid, KRadioCRAudioRoute,             CRadioRepositoryManager::ERadioEntityInt );
+    iRepositoryManager.AddEntityL( KRadioCRUid, KRadioCRHeadsetMuteState,       CRadioRepositoryManager::ERadioEntityInt );
+    iRepositoryManager.AddEntityL( KRadioCRUid, KRadioCRSpeakerMuteState,       CRadioRepositoryManager::ERadioEntityInt );
+    iRepositoryManager.AddEntityL( KRadioCRUid, KRadioCRVisualRadioPowerState,  CRadioRepositoryManager::ERadioEntityInt );
+    iRepositoryManager.AddEntityL( KRadioCRUid, KRadioCRTunedFrequency,         CRadioRepositoryManager::ERadioEntityInt );
+    iRepositoryManager.AddEntityL( KRadioCRUid, KRadioCRDefaultMinVolumeLevel,  CRadioRepositoryManager::ERadioEntityInt );
+    iRepositoryManager.AddEntityL( KRadioCRUid, KRadioCRCurrentRegion,          CRadioRepositoryManager::ERadioEntityInt );
+    iRepositoryManager.AddEntityL( KRadioCRUid, KRadioCRRdsAfSearch,            CRadioRepositoryManager::ERadioEntityInt );
+    iRepositoryManager.AddEntityL( KRadioCRUid, KRadioCRNetworkId,              CRadioRepositoryManager::ERadioEntityDes16 );
+    iRepositoryManager.AddEntityL( KRadioCRUid, KRadioCRSubscriberId,           CRadioRepositoryManager::ERadioEntityDes16 );
+    iRepositoryManager.AddEntityL( KRadioCRUid, KRadioCRCountryCode,            CRadioRepositoryManager::ERadioEntityDes16 );
+
+    InitializeRegionsL();
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioEngineSettings::CRadioEngineSettings( CRadioRepositoryManager& aRepositoryManager, CCoeEnv& aCoeEnv )
+    : CRadioSettingsBase( aRepositoryManager, aCoeEnv )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioEngineSettings::~CRadioEngineSettings()
+    {
+    iRepositoryManager.RemoveObserver( this );
+    iRegions.ResetAndDestroy();
+    iRegions.Close();
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioSettingsSetter.
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineSettings::SetObserver( MRadioSettingsObserver* aObserver )
+    {
+    iObserver = aObserver;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioSettingsSetter.
+// ---------------------------------------------------------------------------
+//
+TInt CRadioEngineSettings::SetHeadsetVolume( TInt aVolume )
+    {
+    return iRepositoryManager.SetEntityValue( KRadioCRUid, KRadioCRHeadsetVolume, aVolume );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioEngineSettings.
+// ---------------------------------------------------------------------------
+//
+TInt CRadioEngineSettings::HeadsetVolume() const
+    {
+    return iRepositoryManager.EntityValueInt( KRadioCRUid, KRadioCRHeadsetVolume );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioSettingsSetter.
+// ---------------------------------------------------------------------------
+//
+TInt CRadioEngineSettings::SetSpeakerVolume( TInt aVolume )
+    {
+    return iRepositoryManager.SetEntityValue( KRadioCRUid, KRadioCRSpeakerVolume, aVolume );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioEngineSettings.
+// ---------------------------------------------------------------------------
+//
+TInt CRadioEngineSettings::SpeakerVolume() const
+    {
+    return iRepositoryManager.EntityValueInt( KRadioCRUid, KRadioCRSpeakerVolume );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioSettingsSetter.
+// ---------------------------------------------------------------------------
+//
+TInt CRadioEngineSettings::SetVolume( TInt aVolume )
+    {
+    if ( AudioRoute() == RadioEngine::ERadioHeadset )
+        {
+        return SetHeadsetVolume( aVolume );
+        }
+    else
+        {
+        return SetSpeakerVolume( aVolume );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioEngineSettings.
+// ---------------------------------------------------------------------------
+//
+TInt CRadioEngineSettings::Volume() const
+    {
+    if ( AudioRoute() == RadioEngine::ERadioHeadset )
+        {
+        return HeadsetVolume();
+        }
+    else
+        {
+        return SpeakerVolume();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioSettingsSetter.
+//
+// ---------------------------------------------------------------------------
+//
+TInt CRadioEngineSettings::SetOutputMode( TInt aOutputMode )
+    {
+    return iRepositoryManager.SetEntityValue( KRadioCRUid, KRadioCROutputMode, aOutputMode );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioEngineSettings.
+//
+// ---------------------------------------------------------------------------
+//
+TInt CRadioEngineSettings::OutputMode() const
+    {
+    return iRepositoryManager.EntityValueInt( KRadioCRUid, KRadioCROutputMode );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioSettingsSetter.
+// Stores the radio audio route ( headset/ihf ) to use.
+// ---------------------------------------------------------------------------
+//
+TInt CRadioEngineSettings::SetAudioRoute( TInt aAudioRoute )
+    {
+    return iRepositoryManager.SetEntityValue( KRadioCRUid, KRadioCRAudioRoute, aAudioRoute );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioEngineSettings.
+// Retrieves the radio audio route in use.
+// ---------------------------------------------------------------------------
+//
+TInt CRadioEngineSettings::AudioRoute() const
+    {
+    return iRepositoryManager.EntityValueInt( KRadioCRUid, KRadioCRAudioRoute );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioSettingsSetter.
+//
+// ---------------------------------------------------------------------------
+//
+TInt CRadioEngineSettings::SetHeadsetVolMuted( TBool aMuted )
+    {
+    return iRepositoryManager.SetEntityValue( KRadioCRUid, KRadioCRHeadsetMuteState, aMuted );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioEngineSettings.
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioEngineSettings::IsHeadsetVolMuted() const
+    {
+    return iRepositoryManager.EntityValueInt( KRadioCRUid, KRadioCRHeadsetMuteState );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioSettingsSetter.
+//
+// ---------------------------------------------------------------------------
+//
+TInt CRadioEngineSettings::SetSpeakerVolMuted( TBool aMuted )
+    {
+    return iRepositoryManager.SetEntityValue( KRadioCRUid, KRadioCRSpeakerMuteState, aMuted );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioEngineSettings.
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioEngineSettings::IsSpeakerVolMuted() const
+    {
+    return iRepositoryManager.EntityValueInt( KRadioCRUid, KRadioCRSpeakerMuteState );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioSettingsSetter.
+//
+// ---------------------------------------------------------------------------
+//
+TInt CRadioEngineSettings::SetVolMuted( TBool aMuted )
+    {
+    if ( AudioRoute() == RadioEngine::ERadioHeadset )
+        {
+        return SetHeadsetVolMuted( aMuted );
+        }
+    else
+        {
+        return SetSpeakerVolMuted( aMuted );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioEngineSettings.
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioEngineSettings::IsVolMuted() const
+    {
+    if ( AudioRoute() == RadioEngine::ERadioHeadset )
+        {
+        return IsHeadsetVolMuted();
+        }
+    else
+        {
+        return IsSpeakerVolMuted();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioSettingsSetter.
+//
+// ---------------------------------------------------------------------------
+//
+TInt CRadioEngineSettings::SetPowerOn( TBool aPowerState )
+    {
+    return iRepositoryManager.SetEntityValue( KRadioCRUid, KRadioCRVisualRadioPowerState, aPowerState );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioEngineSettings.
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioEngineSettings::IsPowerOn() const
+    {
+    return iRepositoryManager.EntityValueInt( KRadioCRUid, KRadioCRVisualRadioPowerState );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioSettingsSetter.
+//
+// ---------------------------------------------------------------------------
+//
+TInt CRadioEngineSettings::SetTunedFrequency( TUint32 aFrequency )
+    {
+    return iRepositoryManager.SetEntityValue( KRadioCRUid,
+                    KRadioCRTunedFrequency, static_cast<TInt>( aFrequency ) );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioEngineSettings.
+//
+// ---------------------------------------------------------------------------
+//
+TUint32 CRadioEngineSettings::TunedFrequency() const
+    {
+    return static_cast<TUint32>( iRepositoryManager.EntityValueInt( KRadioCRUid, KRadioCRTunedFrequency ) );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioEngineSettings.
+//
+// ---------------------------------------------------------------------------
+//
+TInt CRadioEngineSettings::DefaultMinVolumeLevel() const
+    {
+    return iRepositoryManager.EntityValueInt( KRadioCRUid, KRadioCRDefaultMinVolumeLevel );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioEngineSettings.
+//
+// ---------------------------------------------------------------------------
+//
+TInt CRadioEngineSettings::CountRegions() const
+    {
+    return iRegions.Count();
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioEngineSettings.
+//
+// ---------------------------------------------------------------------------
+//
+CRadioRegion& CRadioEngineSettings::Region( TInt aIndex ) const
+    {
+    if ( aIndex == KErrNotFound )
+        {
+        aIndex = RegionIndexForId( DefaultRegion() );
+        }
+
+    return *iRegions[aIndex];
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioEngineSettings.
+//
+// ---------------------------------------------------------------------------
+//
+TRadioRegion CRadioEngineSettings::RegionId() const
+    {
+    return static_cast<TRadioRegion>( iRepositoryManager.EntityValueInt( KRadioCRUid,
+                                                                         KRadioCRCurrentRegion ) );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioEngineSettings.
+//
+// ---------------------------------------------------------------------------
+//
+TRadioRegion CRadioEngineSettings::DefaultRegion() const
+    {
+    TInt region( 0 );
+
+    TRAPD( err, iRepositoryManager.GetRepositoryValueL( KRadioCRUid, KRadioCRDefaultRegion, region ) );
+
+    TRadioRegion regionSetting = static_cast<TRadioRegion>( region );
+
+    if ( err != KErrNone )
+        {
+        regionSetting = ERadioRegionNone;
+        }
+    return regionSetting;
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class MRadioEngineSettings.
+//
+// ---------------------------------------------------------------------------
+//
+TPtrC CRadioEngineSettings::NetworkId() const
+    {
+    return TPtrC( iRepositoryManager.EntityValueDes16( KRadioCRUid, KRadioCRNetworkId ) );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioEngineSettings.
+//
+// ---------------------------------------------------------------------------
+//
+TPtrC CRadioEngineSettings::SubscriberId() const
+    {
+    return TPtrC( iRepositoryManager.EntityValueDes16( KRadioCRUid, KRadioCRSubscriberId ) );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioEngineSettings.
+//
+// ---------------------------------------------------------------------------
+//
+TPtrC CRadioEngineSettings::CountryCode() const
+    {
+    return TPtrC( iRepositoryManager.EntityValueDes16( KRadioCRUid, KRadioCRCountryCode ) );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioSettingsSetter.
+//
+// ---------------------------------------------------------------------------
+//
+TInt CRadioEngineSettings::SetRegionId( TInt aRegion )
+    {
+    __ASSERT_ALWAYS( RegionIndexForId( aRegion ) != KErrNotFound,
+                     User::Panic( _L( "CRadioEngineSettings" ), KErrArgument ) );
+
+    TInt err = iRepositoryManager.SetEntityValue( KRadioCRUid, KRadioCRCurrentRegion, aRegion );
+    if ( !err )
+        {
+        UpdateCurrentRegionIdx( aRegion );
+        err = SetTunedFrequency( Region( iCurrentRegionIdx ).MinFrequency() );
+        }
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioSettingsSetter.
+//
+// ---------------------------------------------------------------------------
+//
+TInt CRadioEngineSettings::SetRdsAfSearch( TBool aEnabled )
+    {
+    return iRepositoryManager.SetEntityValue( KRadioCRUid, KRadioCRRdsAfSearch, aEnabled );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioSettingsSetter.
+//
+// ---------------------------------------------------------------------------
+//
+TInt CRadioEngineSettings::SetNetworkId( const TDesC& aNetworkId )
+    {
+    return iRepositoryManager.SetEntityValue( KRadioCRUid, KRadioCRNetworkId, aNetworkId );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioSettingsSetter.
+//
+// ---------------------------------------------------------------------------
+//
+TInt CRadioEngineSettings::SetSubscriberId( const TDesC& aSubscriberId )
+    {
+    return iRepositoryManager.SetEntityValue( KRadioCRUid, KRadioCRSubscriberId, aSubscriberId );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioSettingsSetter.
+//
+// ---------------------------------------------------------------------------
+//
+TInt CRadioEngineSettings::SetCountryCode( const TDesC& aCountryCode )
+    {
+    return iRepositoryManager.SetEntityValue( KRadioCRUid, KRadioCRCountryCode, aCountryCode );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioEngineSettings.
+//
+// ---------------------------------------------------------------------------
+//
+TUint32 CRadioEngineSettings::FrequencyStepSize() const
+    {
+    return Region( iCurrentRegionIdx ).StepSize();
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioEngineSettings.
+//
+// ---------------------------------------------------------------------------
+//
+TUint32 CRadioEngineSettings::MaxFrequency() const
+    {
+    return Region( iCurrentRegionIdx ).MaxFrequency();
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioEngineSettings.
+//
+// ---------------------------------------------------------------------------
+//
+TUint32 CRadioEngineSettings::MinFrequency() const
+    {
+    return Region( iCurrentRegionIdx ).MinFrequency();
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioEngineSettings.
+//
+// ---------------------------------------------------------------------------
+//
+TInt CRadioEngineSettings::DecimalCount() const
+    {
+    return Region( iCurrentRegionIdx ).DecimalCount();
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioEngineSettings.
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioEngineSettings::RdsAfSearchEnabled() const
+    {
+    return iRepositoryManager.EntityValueInt( KRadioCRUid, KRadioCRRdsAfSearch );
+    }
+
+// ---------------------------------------------------------------------------
+// Initializes the regions based on resources.
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineSettings::InitializeRegionsL()
+    {
+    iRegions.ResetAndDestroy();
+
+    TResourceReader reader;
+    iCoeEnv.CreateResourceReaderLC( reader, R_QRAD_REGIONS );
+
+    TInt regionCount = reader.ReadInt16();
+
+    for ( TInt i = 0 ; i < regionCount; i++ )
+        {
+        TInt resId = reader.ReadInt32(); // The next resource ID to read.
+        TResourceReader regionReader;
+        iCoeEnv.CreateResourceReaderLC( regionReader, resId );
+        CRadioRegion* region = CRadioRegion::NewL( regionReader );
+        CleanupStack::PushL( region );
+
+        if ( IsRegionAllowed( region->Id() ))
+            {
+            User::LeaveIfError( iRegions.Append( region ) );
+            CleanupStack::Pop( region );
+            }
+        else{
+            CleanupStack::PopAndDestroy( region );
+            }
+        CleanupStack::PopAndDestroy();
+        }
+
+    CleanupStack::PopAndDestroy();
+
+    if ( CountRegions() <= 0 || !IsRegionAllowed( DefaultRegion() ) )
+        {
+        User::Leave( KErrCorrupt );
+        }
+
+    UpdateCurrentRegionIdx( RegionId() );
+    }
+
+// ---------------------------------------------------------------------------
+// Converts Region ID to index
+// ---------------------------------------------------------------------------
+//
+TInt CRadioEngineSettings::RegionIndexForId( TInt aRegionId ) const
+    {
+    TInt idx = KErrNotFound;
+    for ( TInt i = 0 ; i < CountRegions(); ++i )
+        {
+        if ( Region( i ).Id() == static_cast<TRadioRegion>( aRegionId ) )
+            {
+            idx = i;
+            break;
+            }
+        }
+    return idx;
+    }
+
+// ---------------------------------------------------------------------------
+// Updates the current region
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineSettings::UpdateCurrentRegionIdx( TInt aRegionId )
+    {
+    iCurrentRegionIdx = RegionIndexForId( aRegionId );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioRepositoryEntityObserver.
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineSettings::HandleRepositoryValueChangeL( const TUid& aUid,
+                                                         TUint32 aKey,
+                                                         TInt aValue,
+                                                         TInt aError )
+    {
+    if ( !aError && aUid == KRadioCRUid && iObserver )
+        {
+        if ( aKey == KRadioCRRdsAfSearch )
+            {
+            iObserver->RdsAfSearchSettingChangedL( aValue );
+            }
+        else if ( aKey == KRadioCRCurrentRegion )
+            {
+            if ( iCurrentRegionIdx != RegionIndexForId( aValue ) )
+                {
+                UpdateCurrentRegionIdx( aValue );
+                __ASSERT_ALWAYS( iCurrentRegionIdx != KErrNotFound,
+                     User::Panic( _L( "CRadioEngineSettings" ), KErrArgument ) );
+                User::LeaveIfError( SetTunedFrequency( Region( iCurrentRegionIdx ).MinFrequency() ) );
+                iObserver->RegionSettingChangedL( aValue );
+                }
+            }
+        else if ( aKey == KRadioCRRdsAfSearch )
+            {
+            iObserver->RdsAfSearchSettingChangedL( aValue );
+            }
+        else
+            {
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Determines if region is allowed .
+// ---------------------------------------------------------------------------
+//
+TBool CRadioEngineSettings::IsRegionAllowed( TRadioRegion aRegionId ) const
+    {
+
+    TInt regionAllowed( EFalse );
+    TInt err( KErrNone );
+
+    switch ( aRegionId )
+        {
+        case ERadioRegionJapan:
+            TRAP( err, iRepositoryManager.GetRepositoryValueL( KRadioCRUid, KRadioCRRegionAllowedJapan, regionAllowed ) );
+            break;
+
+        case ERadioRegionAmerica:
+            TRAP( err, iRepositoryManager.GetRepositoryValueL( KRadioCRUid, KRadioCRRegionAllowedAmerica, regionAllowed ) );
+            break;
+
+        case ERadioRegionDefault:
+            TRAP( err, iRepositoryManager.GetRepositoryValueL( KRadioCRUid, KRadioCRRegionAllowedDefault, regionAllowed ) );
+            break;
+
+        default:
+            break;
+        }
+
+    if ( err != KErrNone )
+        {
+        regionAllowed = EFalse;
+        }
+
+    return TBool( regionAllowed );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/settings/src/cradioregion.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,159 @@
+/*
+* 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:
+*
+*/
+
+// System includes
+#include <barsread.h>
+
+// User includes
+#include "cradioregion.h"
+
+// Used to convert kilohertz values to hertz values
+const TInt KRadioThousand = 1000;
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioRegion::CRadioRegion()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRegion::ConstructL( TResourceReader& aRr )
+    {
+    iId = static_cast<TRadioRegion>( aRr.ReadUint16());
+    iStepSize = static_cast<TUint16>( aRr.ReadUint16() ) * KRadioThousand;
+    iMinFreq = aRr.ReadUint32() * KRadioThousand;
+    iMaxFreq = aRr.ReadUint32() * KRadioThousand;
+    iDecimalCount = aRr.ReadInt16();
+
+    TInt countryCodeCount = aRr.ReadInt16();
+    for ( TInt i = 0 ; i < countryCodeCount ; i++)
+        {
+        TPtrC code;
+        code.Set( aRr.ReadTPtrC());
+        User::LeaveIfError( iCountryCodes.Append( code.AllocL()));
+        }
+
+    iName = aRr.ReadHBufC16L();
+    iSettingName = aRr.ReadHBufC16L();
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioRegion* CRadioRegion::NewL( TResourceReader& aRr )
+    {
+    CRadioRegion* self = new ( ELeave ) CRadioRegion;
+
+    CleanupStack::PushL( self );
+    self->ConstructL( aRr );
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioRegion::~CRadioRegion()
+    {
+    iCountryCodes.ResetAndDestroy();
+    iCountryCodes.Close();
+    delete iName;
+    delete iSettingName;
+    }
+
+// ---------------------------------------------------------
+// Get the id of region
+// ---------------------------------------------------------
+//
+EXPORT_C TRadioRegion CRadioRegion::Id() const
+    {
+    return iId;
+    }
+
+// ---------------------------------------------------------
+// Get the step interval of region
+// ---------------------------------------------------------
+//
+EXPORT_C TUint32 CRadioRegion::StepSize() const
+    {
+    return iStepSize;
+    }
+
+// ---------------------------------------------------------
+//
+// ---------------------------------------------------------
+//
+EXPORT_C TUint32 CRadioRegion::MinFrequency() const
+    {
+    return iMinFreq;
+    }
+
+// ---------------------------------------------------------
+//
+// ---------------------------------------------------------
+//
+EXPORT_C TUint32 CRadioRegion::MaxFrequency() const
+    {
+    return iMaxFreq;
+    }
+
+// ---------------------------------------------------------
+//
+// ---------------------------------------------------------
+//
+EXPORT_C TInt CRadioRegion::DecimalCount() const
+    {
+    return iDecimalCount;
+    }
+
+// ---------------------------------------------------------
+// Get the country code of region
+// ---------------------------------------------------------
+//
+EXPORT_C const RRadioCountryCodeArray& CRadioRegion::CountryCodes()
+    {
+    return iCountryCodes;
+    }
+
+// ---------------------------------------------------------
+// Get the name of region
+// ---------------------------------------------------------
+//
+EXPORT_C const TDesC16& CRadioRegion::Name() const
+    {
+    return *iName;
+    }
+
+// ---------------------------------------------------------
+// Get the name of region
+// ---------------------------------------------------------
+//
+EXPORT_C const TDesC16& CRadioRegion::SettingItemName() const
+    {
+    return *iSettingName;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/settings/src/cradiosettings.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,39 @@
+/*
+* 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:
+*
+*/
+
+// User includes
+#include "cradiosettings.h"
+#include "cradiosettingsimp.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CRadioSettings* CRadioSettings::NewL( CCoeEnv* aCoeEnv )
+{
+    return CRadioSettingsImp::NewL( aCoeEnv );
+}
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CRadioSettings::~CRadioSettings()
+{
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/settings/src/cradiosettingsbase.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,118 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// System includes
+#include <s32mem.h>
+
+// User includes
+#include "cradiorepositorymanager.h"
+#include "cradiosettingsbase.h"
+#include "cradioenginelogger.h"
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioSettingsBase::CRadioSettingsBase( CRadioRepositoryManager& aRepositoryManager,
+                                        CCoeEnv& aCoeEnv )
+    : iCoeEnv( aCoeEnv )
+    , iRepositoryManager( aRepositoryManager )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioSettingsBase::~CRadioSettingsBase()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Writes a desciptor array to the repository.
+// ---------------------------------------------------------------------------
+//
+void CRadioSettingsBase::WriteArrayEntityL( const TUid& aUid, TUint32 aKey, const CDesCArray& aArray )
+    {
+    LOG_FORMAT( "CRadioSettingsBase::WriteArrayEntityL( aUid = %d, aKey = %d )", aUid.iUid, aKey );
+
+    CBufFlat* buf = CBufFlat::NewL( KRadioEntityBuf8Length );
+    CleanupStack::PushL( buf );
+    RBufWriteStream stream( *buf );
+    CleanupClosePushL( stream );
+
+    TInt count = aArray.MdcaCount();
+    stream << TCardinality( count );
+
+    LOG_FORMAT( "     count = %d", count );
+
+    for ( TInt i = 0; i < count; i++ )
+        {
+        DEBUGVAR( TPtrC ptr( aArray.MdcaPoint( i ) ) );
+        LOG_FORMAT( "     entry %d: %S", i, &ptr );
+        stream << aArray.MdcaPoint( i );
+        }
+
+    stream.CommitL();
+
+    CleanupStack::PopAndDestroy( &stream );
+
+    TRadioEntityBuf8 entityBuf( buf->Ptr( 0 ).Left( KRadioEntityBuf8Length ) );
+    User::LeaveIfError( iRepositoryManager.SetEntityValue( aUid, aKey, entityBuf ) );
+
+    CleanupStack::PopAndDestroy( buf );
+    }
+
+// ---------------------------------------------------------------------------
+// Reads a descriptor array from the repository.
+// ---------------------------------------------------------------------------
+//
+CDesCArray* CRadioSettingsBase::ReadArrayEntityL( const TUid& aUid, TUint32 aKey ) const
+    {
+    LOG_FORMAT( "CRadioSettingsBase::ReadArrayEntityL( aUid = %d, aKey = %d )", aUid.iUid, aKey );
+
+    CBufFlat* buf = CBufFlat::NewL( KRadioEntityBuf8Length );
+    CleanupStack::PushL( buf );
+    buf->InsertL( 0, iRepositoryManager.EntityValueDes8( aUid, aKey ) );
+    RBufReadStream stream( *buf );
+    CleanupClosePushL( stream );
+
+    TCardinality count;
+    stream >> count;
+
+    LOG_FORMAT( "     count = %d", static_cast<TInt>( count ) );
+
+    CDesCArray* array = new ( ELeave ) CDesCArrayFlat( Max( static_cast<TInt>( count ), 1 ) );
+    CleanupStack::PushL( array );
+
+    for ( TInt i = 0; i < count; i++ )
+        {
+        HBufC* curBuf = HBufC::NewLC( stream, KMaxTInt );
+        DEBUGVAR( TPtrC ptr( *curBuf ) );
+        LOG_FORMAT( "     entry %d: %S", i, &ptr );
+        array->AppendL( *curBuf );
+        CleanupStack::PopAndDestroy( curBuf );
+        }
+
+    CleanupStack::Pop( array );
+    CleanupStack::PopAndDestroy( 2, buf );
+
+    return array;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/settings/src/cradiosettingsimp.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,253 @@
+/*
+* 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:
+*
+*/
+
+// System includes
+#include <bautils.h>
+#include <coemain.h>
+#include <ConeResLoader.h>
+#include <f32file.h>
+#include <data_caging_path_literals.hrh>
+
+// User includes
+#include "cradiosettingsimp.h"
+#include "cradioapplicationsettings.h"
+#include "cradioenginesettings.h"
+#include "cradiorepositorymanager.h"
+#include "radioengineutils.h"
+#include "radioengineutils.h"
+#include "cradioenginelogger.h"
+
+// The name of the radio settings resource file.
+_LIT( KRadioSettingsResourceFile, "radioenginesettings.rsc" );
+
+// The granularity of the repository manager array.
+const TInt KRadioSettingsRepositoryManagerGranularity = 8;
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioSettingsImp* CRadioSettingsImp::NewL( CCoeEnv* aCoeEnv )
+    {
+    CRadioSettingsImp* self = new (ELeave) CRadioSettingsImp;
+    CleanupStack::PushL( self );
+    self->ConstructL( aCoeEnv );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioSettingsImp::ConstructL( CCoeEnv* aCoeEnv )
+    {
+    RadioEngineUtils::InitializeL( aCoeEnv );
+    LoadResourcesL();
+
+    iRepositoryManager = CRadioRepositoryManager::NewL( KRadioSettingsRepositoryManagerGranularity );
+
+    // Constructs the implementors of the interfaces.
+    iApplicationSettings = CRadioApplicationSettings::NewL( *iRepositoryManager, *RadioEngineUtils::Env() );
+    iEngineSettings = CRadioEngineSettings::NewL( *iRepositoryManager, *RadioEngineUtils::Env() );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioSettingsImp::CRadioSettingsImp()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioSettingsImp::~CRadioSettingsImp()
+    {
+    delete iApplicationSettings;
+    delete iEngineSettings;
+    delete iRepositoryManager;
+
+    if ( iResourceLoader )
+        {
+        iResourceLoader->Close();
+        }
+    delete iResourceLoader;
+    RadioEngineUtils::Release();
+    }
+
+// ---------------------------------------------------------------------------
+// Determines if region is allowed.
+// ---------------------------------------------------------------------------
+//
+TBool CRadioSettingsImp::IsRegionAllowed( TRadioRegion aRegionId ) const
+    {
+    return iEngineSettings->IsRegionAllowed( aRegionId );
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the application settings interface.
+// ---------------------------------------------------------------------------
+//
+MRadioApplicationSettings& CRadioSettingsImp::ApplicationSettings() const
+    {
+    return *iApplicationSettings;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the radio settings interface.
+// ---------------------------------------------------------------------------
+//
+MRadioEngineSettings& CRadioSettingsImp::EngineSettings() const
+    {
+    return *iEngineSettings;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the radio settings setter interface.
+// ---------------------------------------------------------------------------
+//
+MRadioSettingsSetter& CRadioSettingsImp::RadioSetter() const
+    {
+    return *iEngineSettings;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the underlying repository.
+// ---------------------------------------------------------------------------
+//
+CRadioRepositoryManager& CRadioSettingsImp::Repository() const
+    {
+    return *iRepositoryManager;
+    }
+
+// ---------------------------------------------------------------------------
+// Static version of ResolveDriveL.
+// ---------------------------------------------------------------------------
+//
+void CRadioSettingsImp::ResolveDriveL( TFileName& aFileName, const TDesC& aPath )
+    {
+    LOG_FORMAT( "CRadioSettingsImp::ResolveDriveL( aFileName = %S, aPath = %S )", &aFileName, &aPath );
+
+    RFs& fsSession = RadioEngineUtils::FsSession();
+    TFileName fileName;
+    TFileName baseResource;
+    TFindFile finder( fsSession );
+    TLanguage language( ELangNone );
+
+    _LIT( resourceFileExt, ".rsc" );
+    _LIT( resourceFileWildExt, ".r*" );
+
+    TParsePtrC parse( aFileName );
+    TBool isResourceFile = ( parse.Ext() == resourceFileExt() );
+
+    TInt err = KErrUnknown;
+    if  ( isResourceFile )
+        {
+        CDir* entries = NULL;
+        fileName.Copy( parse.Name() );
+        fileName.Append( resourceFileWildExt() );
+        err = finder.FindWildByDir( fileName, aPath, entries );
+        delete entries;
+        }
+    else
+        {
+        // TFindFile applies search order that is from
+        // drive Y to A, then Z
+        err = finder.FindByDir( aFileName, aPath );
+        }
+
+    LOG_FORMAT( "CRadioSettingsImp::ResolveDriveL - err = %d", err );
+    TBool found = EFalse;
+    if ( !isResourceFile && err == KErrNone )
+        {
+        found = ETrue;
+        aFileName.Zero();
+        aFileName.Append( finder.File() );
+        }
+
+    while ( !found && err == KErrNone && isResourceFile )
+        {
+        // Found file
+        fileName.Zero();
+        TParsePtrC foundPath( finder.File() );
+        fileName.Copy( foundPath.DriveAndPath() );
+        fileName.Append( aFileName );
+        BaflUtils::NearestLanguageFile( fsSession, fileName, language );
+        if ( language != ELangNone && BaflUtils::FileExists( fsSession, fileName ) )
+            {
+            found = ETrue;
+            aFileName.Zero();
+            aFileName.Copy( fileName );
+            }
+        else
+            {
+            if ( language == ELangNone &&
+                 !baseResource.Compare( KNullDesC ) &&
+                 BaflUtils::FileExists( fsSession, fileName ) )
+                {
+                baseResource.Copy( fileName );
+                }
+            CDir* entries = NULL;
+            err = finder.FindWild( entries );
+            delete entries;
+            }
+        }
+
+    if ( !found && baseResource.Compare( KNullDesC ) )
+        {
+        // If we found *.rsc then better to use that than nothing
+        if ( BaflUtils::FileExists( fsSession, baseResource ) )
+            {
+            found = ETrue;
+            aFileName.Zero();
+            aFileName.Append( baseResource );
+            }
+        }
+
+    if ( !found )
+        {
+        LOG_FORMAT( "CRadioSettingsImp::ResolveDriveL - File %S not found ( err = %d )!", &aFileName, err );
+        User::Leave( KErrNotFound );
+        }
+
+    LOG_FORMAT( "CRadioSettingsImp::ResolveDriveL( aFileName = %S )", &aFileName );
+    }
+
+// ---------------------------------------------------------------------------
+// Loads the required resources.
+// ---------------------------------------------------------------------------
+//
+void CRadioSettingsImp::LoadResourcesL()
+    {
+    // Allocated in heap only so that the resource loader header doesn't need to be
+    // included in the header of this class. This is because this will be included
+    // by a QT component that should not depend on CONE
+    iResourceLoader = new (ELeave) RConeResourceLoader( *RadioEngineUtils::Env() );
+
+    TFileName resourceFileName;
+    resourceFileName.Append( KRadioSettingsResourceFile );
+
+    ResolveDriveL( resourceFileName, KDC_RESOURCE_FILES_DIR );
+
+    iResourceLoader->OpenL( resourceFileName );
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/api/cradioaudiorouter.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef C_RADIOAUDIOROUTER_H
+#define C_RADIOAUDIOROUTER_H
+
+#include <e32base.h>
+
+#include "radioenginedef.h"
+
+// Forward declarations
+class CRadioRoutableAudio;
+class MRadioAudioRoutingObserver;
+
+/**
+ * CRadioAudioRouter
+ *
+ * Contains functionality for playing and routing startup sound
+ *
+ */
+NONSHARABLE_CLASS( CRadioAudioRouter ) : public CBase
+    {
+public:
+
+    IMPORT_C static CRadioAudioRouter* NewL( MRadioAudioRoutingObserver& aAudioRoutingObserver );
+
+    IMPORT_C ~CRadioAudioRouter();
+
+    /**
+     * Sets audio route
+     *
+     * @param aAudioRoute new audio route
+     */
+    IMPORT_C void SetAudioRouteL( RadioEngine::TRadioAudioRoute aAudioRoute );
+
+    /**
+     * Register routable audio which routing will be changed via this class.
+     *
+     * @param aRoutableAudio audio which routing will be added to routable
+     * audios. Ownership is not moved.
+     */
+    IMPORT_C void RegisterRoutableAudio( CRadioRoutableAudio* aRoutableAudio );
+
+    /**
+     * Removes registration of routable audio.
+     *
+     * @param aRoutableAudio audio which routing registration will be
+     * removed. Ownership is not moved.
+     */
+    IMPORT_C void UnRegisterRoutableAudio( CRadioRoutableAudio* aRoutableAudio );
+
+private:
+
+    CRadioAudioRouter( MRadioAudioRoutingObserver& aAudioRoutingObserver );
+
+    void ConstructL();
+
+private: // data
+
+    /**
+     * Reference to audio routing observer. Gets informed when audio routing
+     * is changed.
+     */
+    MRadioAudioRoutingObserver& iAudioRoutingObserver;
+
+    /**
+     * Contains routable audios.
+     */
+    RArray<CRadioRoutableAudio*> iRoutableAudios;
+
+    };
+
+#endif // C_RADIOAUDIOROUTER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/api/cradioenginelogger.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,477 @@
+/*
+* 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 C_RADIOENGINELOGGER_H
+#define C_RADIOENGINELOGGER_H
+
+// System includes
+#include <e32base.h>
+
+// User includes
+#include "mradioenginelogger.h"
+
+/**
+ * Main logging macro.
+ * When the macro is defined, logging is on
+ */
+#ifdef _DEBUG
+    #define LOGGING_ENABLED
+#endif
+
+#ifdef LOGGING_ENABLED
+
+/**
+ * Log file path.
+ * If the path points to memory card and the card is not present or is read only,
+ * the log is written to C: drive.
+ */
+_LIT( KLogFile, "c:\\logs\\radio\\radioenginelog.txt" );
+
+/**
+ * Logging buffer length. Should be big enough to hold one line of text
+ */
+const TInt KLogBufferLength = 512;
+
+
+// ===========================================================================
+// ===========================================================================
+//
+// BEGIN LOGGING MACROS. Use these to write log prints
+//
+// ===========================================================================
+// ===========================================================================
+
+// All macros except LOG_METHOD and LOG_METHOD_RET are enclosed in do { }while( 0 );
+// statements to make them form a complete code block that can be used anywhere.
+
+/**
+ * Function entry, exit and leave logging.
+ *
+ *  @code
+ *   LOG_METHOD( "CSomeClass::SomeFunctionL" );
+ *  @endcode
+ */
+#define LOG_METHOD( func ) TRadioMethodLogger ___methodLogger( _S( func ), _S( "" ) )
+
+/**
+ * Function entry, exit and leave logging.
+ * Gets the function name automatically
+ *
+ *  @code
+ *   LOG_METHOD_AUTO;
+ *  @endcode
+ */
+// Substract 1 from MaxLength() because PtrZ() adds the zero terminator
+#define LOG_METHOD_AUTO \
+    TPtrC8 __ptr8( (const TUint8*)__PRETTY_FUNCTION__ ); \
+    TBuf<150> __buf; \
+    __buf.Copy( __ptr8.Left( __buf.MaxLength() - 1 ) ); \
+    TRadioMethodLogger ___methodLogger( __buf.PtrZ(), _S( "" ) )
+
+/**
+ * Function entry, exit and leave logging. Logs also returned value
+ * NOTE! At the moment return value is only logged in emulator builds.
+ *
+ *  @code
+ *   // Function returns an integer value
+ *   LOG_METHOD_RET( "CSomeClass::SomeFunctionL", "Error: %d" );
+ *
+ *   // Function returns an HBufC pointer
+ *   LOG_METHOD_RET( "CSomeClass::SomeFunctionL", "HBufC: %S" );
+ *  @endcode
+ */
+#define LOG_METHOD_RET( func,fmt ) TRadioMethodLogger ___methodLogger( _S( func ), _S( fmt ) )
+
+/**
+ * Function entry, exit and leave logging. Logs also returned value
+ * Gets the function name automatically
+ * NOTE! At the moment return value is only logged in emulator builds.
+ *
+ *  @code
+ *   // Function returns an integer value
+ *   LOG_METHOD_RET( "CSomeClass::SomeFunctionL", "Error: %d" );
+ *
+ *   // Function returns an HBufC pointer
+ *   LOG_METHOD_RET( "CSomeClass::SomeFunctionL", "HBufC: %S" );
+ *  @endcode
+ */
+// Substract 1 from MaxLength() because PtrZ() adds the zero terminator
+#define LOG_METHOD_AUTO_RET( fmt ) \
+    TPtrC8 __ptr8( (const TUint8*)__PRETTY_FUNCTION__ ); \
+    TBuf<150> __buf; \
+    __buf.Copy( __ptr8.Left( __buf.MaxLength() - 1 ) ); \
+    TRadioMethodLogger ___methodLogger( __buf.PtrZ(), _S( fmt ) )
+
+/**
+ * Simple assert macro that works like normal asserts. The expression ( expr ) is
+ * expected to be true in which case nothing is done. If the expression is false the
+ * statement ( stmt ) is executed.
+ *
+ * Note! As with normal asserts, do not put a function call as the expression because
+ * it will not be executed when logging is off!
+ *
+ *  @code
+ *   // Log error code if it is not KErrNone
+ *   TRAPD( err, SomeFunctionL() );
+ *   MTV_ASSERT( !err, LOG_FORMAT( "Operation failed. error: %d", err ) );
+ *  @endcode
+ */
+#define LOG_ASSERT( expr, stmt ) do { if ( !( expr )) { stmt; } }while( 0 )
+
+#define DEBUGVAR( var ) var
+
+/**
+ * Writes a formatted string to log. Accepts variable number of parameters
+ *
+ *  @code
+ *   LOG_FORMAT( "Integer: %d", 1 );
+ *   LOG_FORMAT( "Integer: %d Desc %S", 1, &desc );
+ *   LOG_FORMAT( "Integer: %d Desc %S hex 0x%X", 1, &desc, 0xC0FFEE );
+ *  @endcode
+ */
+#define LOG_FORMAT( fmt,args...) do{MRadioEngineLogger::Logger()->AddIndent( KMarkerEngine()).AddFormat( _L( fmt ),args ).Commit();}while( 0 )
+
+/**
+ * Writes current time to log. Example: Time: 13.9.2007 13:23:25.383750
+ */
+#define LOG_CURRENT_TIME() do{MRadioEngineLogger::Logger()->AddIndent( KMarkerEngine()).AddTimestamp().Commit();}while( 0 )
+
+/**
+ * Writes a time to log. Accepts a TTime as parameter
+ *
+ *  @code
+ *   TTime now;
+ *   now.HomeTime();
+ *   LOG_TIME( now );
+ *  @endcode
+ */
+#define LOG_TIME( x ) do{MRadioEngineLogger::Logger()->AddIndent( KMarkerEngine()).AddTimestamp( x ).Commit();}while( 0 )
+
+/**
+ * Writes a time to log. Accepts a string and a TTime as parameter
+ *
+ *  @code
+ *   TTime now;
+ *   now.HomeTime();
+ *   LOG_TIME2( "Current time", now );
+ *  @endcode
+ */
+#define LOG_TIME2( desc, time ) do{MRadioEngineLogger::Logger()->AddIndent( KMarkerEngine()).Add( desc ).Add( ": " ).Add( time ).Commit();}while( 0 )
+
+/**
+ * Clear the log contents
+ */
+#define LOG_CLEAR() do{MRadioEngineLogger::Logger()->ClearLog();}while( 0 )
+
+/**
+ * Construct a log line one item at a time. No newline at end
+ */
+//#define LOG( x ) do{CRadioEngineLogger::Logger()->Add( x );}while( 0 )
+
+/**
+ * Write a newline to log
+ */
+#define LOG_NEWLINE() do{MRadioEngineLogger::Logger()->Commit();}while( 0 )
+
+/**
+ * Macro that behaves like User::LeaveIfError except it logs the leave
+ * The line "TInt __error_code = expr;" makes sure the expression is evaluated only once
+ */
+#define LEAVEIFERROR( expr )                                                \
+    do {                                                                    \
+        TInt __err = expr;                                                  \
+        if ( __err )                                                        \
+            {                                                               \
+            _LIT( KExpression, #expr );                                     \
+            LOG_FORMAT( "%S leaving with code %d!", &KExpression, __err );  \
+            User::Leave( __err );                                           \
+            }                                                               \
+        } while( 0 )
+
+/**
+ * Macro that behaves like User::Leave except it logs the leave
+ * The line "TInt __error_code = expr;" makes sure the expression is evaluated only once
+ */
+#define LEAVE( expr )                                   \
+    do {                                                \
+        TInt __err = expr;                              \
+        LOG_FORMAT( "Leaving with code %d!", __err );   \
+        User::Leave( __err );                           \
+        } while( 0 )
+
+/**
+ * Macro that behaves like TRAP except it logs the possible error
+ */
+#define TRAP_AND_LOG_ERR( err, expr )                               \
+    TRAP( err, expr );                                              \
+    if ( err )                                                      \
+        {                                                           \
+        _LIT( KExpression, #expr );                                 \
+        LOG_FORMAT( "%S failed with err %d", &KExpression, err );   \
+        }                                                           \
+
+/**
+ * Macro that behaves like TRAPD except it logs the possible error
+ */
+#define TRAPD_AND_LOG_ERR( err, expr )  \
+    TInt err = 0;                       \
+    TRAP_AND_LOG_ERR( err, expr )
+
+
+/**
+ * Macro that behaves like TRAP_IGNORE except it logs the possible error
+ */
+#define TRAP_IGNORE_AND_LOG_ERR( expr )     \
+    do {                                    \
+        TRAPD_AND_LOG_ERR( __err, expr );     \
+        } while ( 0 )
+
+/**
+ * Write a single log line.
+ */
+#define LOGGER_WRITE( x ) do{MRadioEngineLogger::Logger()->AddIndent( KMarkerEngine ).Add( _L8( x ) ).Commit();}while( 0 )
+#define LOG( x ) do{MRadioEngineLogger::Logger()->AddIndent( KMarkerEngine ).Add( x ).Commit();}while( 0 )
+//#define LOG2( x1, x2 ) do{CRadioEngineLogger::Logger()->AddIndent().Add( x1 ).Add( x2 ).Commit();}while( 0 )
+//#define LOG3( x1, x2, x3 ) do{CRadioEngineLogger::Logger()->AddIndent().Add( x1 ).Add( x2 ).Add( x3 ).Commit();}while( 0 )
+//#define LOG4( x1, x2, x3, x4 ) do{CRadioEngineLogger::Logger()->AddIndent().Add( x1 ).Add( x2 ).Add( x3 ).Add( x4 ).Commit();}while( 0 )
+//#define LOG5( x1, x2, x3, x4, x5 ) do{CRadioEngineLogger::Logger()->AddIndent().Add( x1 ).Add( x2 ).Add( x3 ).Add( x4 ).Add( x5 ).Commit();}while( 0 )
+
+
+// ===========================================================================
+// ===========================================================================
+//
+// END LOGGING MACROS. Do not use anything below this line directly!
+//
+// ===========================================================================
+// ===========================================================================
+
+
+#include <f32file.h>
+#include <e32debug.h>
+
+class TRadioMethodLogger;
+
+const TInt KTimestampLength = 40;
+typedef TBuf8<KTimestampLength> TTimestamp;
+
+/**
+ * Logger for writing log to a file and RDebug
+ *
+ *  @lib mtvcommon.lib
+ *  @since Live TV UI v1.0
+ */
+NONSHARABLE_CLASS( CRadioEngineLogger ) : public CBase
+                                        , public MRadioEngineLogger
+                                        , public TDes16Overflow
+    {
+    friend class CRadioEngineTls;
+public:
+
+// from base class MRadioEngineLogger
+
+    MRadioEngineLogger& ClearLog();
+    MRadioEngineLogger& Add( const TDesC8& aMsg );
+    MRadioEngineLogger& Add( const TDesC& aMsg );
+    MRadioEngineLogger& Add( TInt aInt );
+    MRadioEngineLogger& Add( const TReal& aReal );
+    MRadioEngineLogger& Add( const char* aText );
+    MRadioEngineLogger& Add( const TAny* aPtr );
+    MRadioEngineLogger& Add( const TTime& aTime );
+    MRadioEngineLogger& AddTimestamp();
+    MRadioEngineLogger& AddFormat( TRefByValue<const TDesC> aFmt, ... );
+    MRadioEngineLogger& AddIndent( const TDesC& aMarker );
+    MRadioEngineLogger& AddIndentClear( const TDesC& aMarker );
+    MRadioEngineLogger& IncIndent();
+    MRadioEngineLogger& DecIndent();
+    MRadioEngineLogger& Commit( TBool aNewLine = ETrue );
+
+// from base class TDes16Overflow
+
+    /**
+     * Handles the overflow from AppendFormatList()
+     *
+     * @since Live TV UI v1.0
+     * @param aDes The 16-bit modifiable descriptor whose overflow results in the
+     *             call to this overflow handler.
+     */
+    void Overflow( TDes16 &aDes );
+
+private:
+
+    static CRadioEngineLogger* NewL( RFs& aFs );
+
+    ~CRadioEngineLogger();
+
+    CRadioEngineLogger( RFs& aFs );
+
+    void ConstructL();
+
+    /**
+     * Returns the amount of characters that still fit in the buffer
+     *
+     * @since Live TV UI v1.0
+     * @return Amount of space available
+     */
+    TInt Available() const;
+
+    /**
+     * Templated function to add either 8-bit or 16-bit descriptor to buffer
+     *
+     * @since Live TV UI v1.0
+     * @param aDesc Descriptor to add
+     */
+    template<class PTR, class DESC>
+    void AddDesC( const DESC& aDesc );
+
+    /**
+     * Parses the timestamp from the given TTime
+     *
+     * @since Live TV UI v1.0
+     * @param aTime Time to parse
+     * @param aTimestamp On return, the parsed timestamp
+     */
+    void ParseTimestamp( const TTime& aTime, TTimestamp& aTimestamp );
+
+private: // data
+
+    /**
+     * Reference to file server session.
+     */
+    RFs&    iFs;
+
+    /**
+     * File handle
+     */
+    RFile   iFile;
+
+    /**
+     * Name of the log file.
+     * Own.
+     */
+    HBufC*  iFileName;
+
+    /**
+     * Logging buffer. holds one log line at a time
+     */
+    TBuf8<KLogBufferLength> iBuf8;
+
+    /**
+     * Indentation
+     */
+    TInt    iIndent;
+
+    /**
+     * Flag to indicate whether or not timestamp has already been written to the beginning of line
+     */
+    TBool   iTimeStampWritten;
+
+    };
+
+/**
+ * Helper class for method entry, exit and leave logging.
+ * Used as automatic variable declared by LOG_METHOD() macro.
+ */
+NONSHARABLE_CLASS( TRadioMethodLogger )
+    {
+public:
+
+    /**
+     * Constructor. Writes method entry log.
+     */
+    IMPORT_C TRadioMethodLogger( const TText* aFunc, const TText* aRetFormat );
+
+    /**
+     * Destructor. Writes method exit log.
+     */
+    IMPORT_C ~TRadioMethodLogger();
+
+private: // data
+
+    /**
+     * Pointer descriptor to function signature that is to be logged.
+     */
+    TPtrC iFunc;
+
+    /**
+     * Formatting string used to print the function return value
+     */
+    TPtrC iRetFormat;
+
+    };
+
+#else // LOGGING_ENABLED
+
+// Empty macro definitions for non logging build.
+
+#define LOG_METHOD_AUTO
+#define LOG_METHOD_AUTO_RET( fmt )
+
+#define LOG_METHOD( func )
+#define LOG_METHOD_RET( func,fmt )
+#define LOG_FORMAT( fmt,args...)
+#define LOG_ASSERT( expr, stmt )
+#define DEBUGVAR( var )
+
+#define LOG_CURRENT_TIME()
+#define LOG_TIME( x )
+#define LOG_TIME2( desc, time )
+
+#define LOG_CLEAR()
+#define LOG( x )
+#define LOG_NEWLINE()
+#define LOG1( x )
+#define LOG2( x1, x2 )
+#define LOG3( x1, x2, x3 )
+#define LOG4( x1, x2, x3, x4 )
+#define LOG5( x1, x2, x3, x4, x5 )
+
+// Default implementations for leave macros.
+// Note! These can NOT be empty macros because the errors would not be checked when logging is off
+#define LEAVEIFERROR( expr )    User::LeaveIfError( expr )
+#define LEAVE( expr )           User::Leave( expr )
+
+// Default implementation for trap macros
+// Note! As with leave macros, these can not be empty
+#define TRAP_AND_LOG_ERR( err,stmt )      TRAP( err, stmt )
+#define TRAPD_AND_LOG_ERR( err,stmt )     TRAPD( err, stmt )
+#define TRAP_IGNORE_AND_LOG_ERR( stmt )   TRAP_IGNORE( stmt )
+
+#define LOGGER_WRITE( x )
+
+// ===========================================================================
+// Dummy classes to keep the exports unchanged when logging is turned off
+// These can not be used.
+// ===========================================================================
+class RFs;
+NONSHARABLE_CLASS( CRadioEngineLogger ) : public CBase
+    {
+    friend class CRadioEngineImp;
+private:
+    static void InitializeL( RFs& aFs );
+    static void Release();
+    };
+
+NONSHARABLE_CLASS( TRadioMethodLogger )
+    {
+public:
+    IMPORT_C TRadioMethodLogger( const TText* /*aFunc*/, const TText* /*aRetFormat*/ );
+    IMPORT_C ~TRadioMethodLogger();
+    };
+
+#endif // LOGGING_ENABLED
+
+#endif // C_RADIOENGINELOGGER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/api/cradiopubsub.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,164 @@
+/*
+* 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 CRADIOPUBSUB_H
+#define CRADIOPUBSUB_H
+
+#include <e32base.h>
+
+#include "radiointernalpskeys.h"
+
+class MRadioControlEventObserver;
+
+/**
+ *  Publish&Subscribe interface of Visual Radio Application.
+ */
+NONSHARABLE_CLASS( CRadioPubSub ) : public CBase
+    {
+public:
+
+    IMPORT_C static CRadioPubSub* NewL();
+
+    IMPORT_C virtual ~CRadioPubSub();
+
+    /**
+     * Publishes active channel number to P&S.
+     *
+     * @param aChannelId The channel ID to publish.
+     */
+    virtual TBool PublishChannel( TInt aChannelId ) const = 0;
+
+    /**
+     * Publishes active frequency to P&S.
+     *
+     * @param aFreq The frequency to publish.
+     */
+    virtual TBool PublishFrequency( TUint32 aFreq ) const = 0;
+
+    /**
+     * Publishes radio power state to P&S.
+     *
+     * @param aPowerOn The radio power state to publish.
+     */
+    virtual TBool PublishPowerState( TBool aPowerOn ) const = 0;
+
+    /**
+     * Publishes current volume level to P&S.
+     *
+     * @param aVol The current volume level to publish.
+     */
+    virtual TBool PublishVolume( TInt aVol ) const = 0;
+
+    /**
+     * Publishes changed channel number to P&S.
+     *
+     * @param aChannelId The channel ID to publish.
+     */
+    virtual TBool PublishChannelDataChanged( TInt aChannelId ) const = 0;
+
+    /**
+     * Publishes the tuning state to P&S.
+     * @param aTuningState The tuning state to publish.
+     */
+    virtual TBool PublishTuningState( TRadioPSTuningState aTuningState ) const = 0;
+
+    /**
+     * Publishes radio mute state to P&S.
+     *
+     * @param aMuted The radio mute state to publish.
+     */
+    virtual TBool PublishRadioMuteState( TBool aMuted ) const = 0;
+
+    /**
+     * Publishes application running state to P&S.
+     *
+     * @param aRunningState The application running state.
+     */
+    virtual TBool PublishApplicationRunningState( TRadioPSApplicationRunningState aRunningState ) const = 0;
+
+    /**
+     * Publishes the headset status to P&S.
+     *
+     * @param aHeadsetStatus The headset's status.
+     */
+    virtual TBool PublishHeadsetStatus( TRadioPSHeadsetStatus aHeadsetStatus ) const = 0;
+
+    /**
+     * Publishes the frequency decimal count to P&S.
+     * @param aDecimalCount The decimal count.
+     */
+    virtual TBool PublishFrequencyDecimalCount( TRadioPSFrequencyDecimalCount aDecimalCount ) const = 0;
+
+    /**
+     * Publishes speaker status. Before state is set for first time it is in
+     * <code>ERadioPSSpeakerUninitialized</code> state.
+     *
+     * @param aLoudspeakerStatus Status of the speaker
+     */
+    virtual TBool PublishLoudspeakerStatus( TRadioPSLoudspeakerStatus aLoudspeakerStatus ) const = 0;
+
+    /**
+     * Publishes Rds Program Service information.
+     *
+     * @param aProgramService Rds Program service descriptor
+     */
+    virtual TBool PublishRdsProgramService( const TDesC& aProgramService ) const = 0;
+
+    /**
+     * Publishes Rds Radio Text information.
+     *
+     * @param aRadioText The Radio Text information to be published.
+     */
+    virtual TBool PublishRdsRadioText( const TDesC& aRadioText ) const = 0;
+
+    /**
+     * Publishes Channel name information.
+     *
+     * @param aName The name to be published.
+     */
+    virtual TBool PublishChannelName( const TDesC& aName ) const = 0;
+
+    /**
+     * Publishes the number of presets in the active preset list.
+     *
+     * @param aCount The number of presets.
+     */
+    virtual TBool PublishActivePreseListCount( TInt aCount ) const = 0;
+
+    /**
+     * Publishes the focus in the active preset list.
+     *
+     * @param aIndex The focus in the active preset list.
+     */
+    virtual TBool PublishActivePreseListFocus( TInt aIndex ) const = 0;
+
+    /**
+     * Publishes the antenna state ( attach/detach ).
+     *
+     * @param aState The current antenna state.
+     */
+    virtual TBool PublishAntennaState( TRadioPSRadioAntennaState aState ) const = 0;
+
+    /**
+     * Sets the UI side control event observer.
+     * @param aControlEventObserver the observer for control events
+     */
+    virtual void SetControlEventObserver( MRadioControlEventObserver* aControlEventObserver ) = 0;
+
+    };
+
+#endif // CRADIOPUBSUB_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/api/cradioremcontarget.h	Fri Jun 04 10:21:36 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:
+*
+*/
+
+#ifndef CRADIOREMCONTARGET_H
+#define CRADIOREMCONTARGET_H
+
+// System includes
+#include <e32base.h>
+
+// Forward declarations
+class MRadioControlEventObserver;
+
+// Class declaration
+
+NONSHARABLE_CLASS( CRadioRemConTarget ) : public CBase
+    {
+public:
+
+    IMPORT_C static CRadioRemConTarget* NewL();
+
+    virtual ~CRadioRemConTarget();
+
+    /**
+     * Sets control event observer.
+     * @param aControlEventObserver the observer for control events
+     */
+    virtual void SetControlEventObserver( MRadioControlEventObserver* aControlEventObserver ) = 0;
+
+    };
+
+#endif // CRADIOREMCONTARGET_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/api/cradiorepositorymanager.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,255 @@
+/*
+* 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 C_RADIOREPOSITORYMANAGER_H
+#define C_RADIOREPOSITORYMANAGER_H
+
+// System includes
+#include <e32base.h>
+
+// Forward declarations
+class MRadioRepositoryEntityObserver;
+
+/** The maximum length of a string buffer. */
+const TInt KRadioEntityBuf16Length = 256; // Maximum: NCentralRepositoryConstants::KMaxUnicodeStringLength;
+/** The maximum length of a binary buffer. */
+const TInt KRadioEntityBuf8Length = KRadioEntityBuf16Length * 2; // Maximum: NCentralRepositoryConstants::KMaxBinaryLength;
+
+/** Maximum length binary buffer. */
+typedef TBuf8<KRadioEntityBuf8Length> TRadioEntityBuf8;
+/** Maximum length string buffer. */
+typedef TBuf16<KRadioEntityBuf16Length> TRadioEntityBuf16;
+
+/**
+ *  Central repository entity manager.
+ *
+ *  Manages central repository entities that listen to specific repository and a key within it, notifying the observer
+ *  whenever the key's value changes.
+ *
+ *  Also a set of static methods are provided that wrap the common use case of central repository where the user
+ *  is only interested to read or write the value of a key and then discard the repository object.
+ */
+NONSHARABLE_CLASS( CRadioRepositoryManager ) : public CBase
+    {
+
+public:
+
+    /**
+     * Possible entity types.
+     */
+    enum TRadioEntityType
+        {
+        ERadioEntityInt,   /**< The entity is an integer. */
+        ERadioEntityReal,  /**< The entity is a floating point number. */
+        ERadioEntityDes8,  /**< The entity is a binary value. */
+        ERadioEntityDes16  /**< The entity is a string. */
+        };
+
+    IMPORT_C static CRadioRepositoryManager* NewL( TInt aGranularity );
+
+    IMPORT_C ~CRadioRepositoryManager();
+
+    /**
+     * Adds observer
+     *
+     * @param aObserver The observer that is notified of all the changes in the observed keys' values.
+     */
+    virtual void AddObserverL( MRadioRepositoryEntityObserver* aObserver ) = 0;
+
+    /**
+     * Removes observer
+     *
+     * @param aObserver The observer that is to be removed
+     */
+    virtual void RemoveObserver( MRadioRepositoryEntityObserver* aObserver ) = 0;
+
+    /**
+     * Enables or disables the writing of entities' values to the repository.
+     *
+     * Disabling the save functionality is important when the free disk space reaches critical level.
+     *
+     * @param   aEnable     <code>ETrue</code> if the entities are allowed to write their value to the repository, <code>EFalse</code> otherwise.
+     */
+    virtual void EnableSave( TBool aEnable ) = 0;
+
+    /**
+     * Adds an entity to the manager.
+     *
+     * @param   aUid        The UID of the repository.
+     * @param   aKey        The key within the repository.
+     * @param   aType       The type of the key within the repository.
+     */
+    virtual void AddEntityL( const TUid& aUid, TUint32 aKey, TRadioEntityType aType ) = 0;
+
+    /**
+     * Removes an entity from the manager.
+     *
+     * Entities should only be removed when they are no longer needed. The destructor of the repository manager
+     * deletes all the remaining entities.
+     *
+     * @param   aUid        The UID of the entity to be removed.
+     * @param   aKey        The key of the entity to be removed.
+     */
+    virtual void RemoveEntity( const TUid& aUid, TUint32 aKey ) = 0;
+
+    /**
+     * Sets the value of an integer entity.
+     *
+     * @param   aUid        The UID of the entity.
+     * @param   aKey        The key of the entity.
+     * @param   aValue      The value to set.
+     */
+    virtual TInt SetEntityValue( const TUid& aUid, TUint32 aKey, TInt aValue ) = 0;
+
+    /**
+     * Sets the value of a floating point entity.
+     *
+     * @param   aUid        The UID of the entity.
+     * @param   aKey        The key of the entity.
+     * @param   aValue      The value to set.
+     */
+    virtual TInt SetEntityValue( const TUid& aUid, TUint32 aKey, const TReal& aValue ) = 0;
+
+    /**
+     * Sets the value of a binary entity.
+     *
+     * @param   aUid        The UID of the entity.
+     * @param   aKey        The key of the entity.
+     * @param   aValue      The value to set.
+     */
+    virtual TInt SetEntityValue( const TUid& aUid, TUint32 aKey, const TDesC8& aValue ) = 0;
+
+    /**
+     * Sets the value of a string entity.
+     *
+     * @param   aUid        The UID of the entity.
+     * @param   aKey        The key of the entity.
+     * @param   aValue      The value to set.
+     */
+    virtual TInt SetEntityValue( const TUid& aUid, TUint32 aKey, const TDesC16& aValue ) = 0;
+
+    /**
+     * Returns the cached value of an integer entity.
+     *
+     * @param   aUid        The UID of the entity.
+     * @param   aKey        The key of the entity.
+     * @return  The cached value of the entity.
+     */
+    virtual TInt EntityValueInt( const TUid& aUid, TUint32 aKey ) const = 0;
+
+    /**
+     * Returns the cached value of a floating point entity.
+     *
+     * @param   aUid        The UID of the entity.
+     * @param   aKey        The key of the entity.
+     * @return  The cached value of the entity.
+     */
+    virtual const TReal& EntityValueReal( const TUid& aUid, TUint32 aKey ) const = 0;
+
+    /**
+     * Returns the cached value of a binary entity.
+     *
+     * @param   aUid        The UID of the entity.
+     * @param   aKey        The key of the entity.
+     * @return  The cached value of the entity.
+     */
+    virtual const TDesC8& EntityValueDes8( const TUid& aUid, TUint32 aKey ) const = 0;
+
+    /**
+     * Returns the cached value of a string entity.
+     *
+     * @param   aUid        The UID of the entity.
+     * @param   aKey        The key of the entity.
+     * @return  The cached value of the entity.
+     */
+    virtual const TDesC16& EntityValueDes16( const TUid& aUid, TUint32 aKey ) const = 0;
+
+    /**
+     * Sets the value of an integer key in the repository.
+     *
+     * @param   aUid        The UID of the repository.
+     * @param   aKey        The key within the repository.
+     * @param   aValue      The value to set.
+     */
+    IMPORT_C static void SetRepositoryValueL( const TUid& aUid, TUint32 aKey, TInt aValue );
+
+    /**
+     * Sets the value of a floating point key in the repository.
+     *
+     * @param   aUid        The UID of the repository.
+     * @param   aKey        The key within the repository.
+     * @param   aValue      The value to set.
+     */
+    IMPORT_C static void SetRepositoryValueL( const TUid& aUid, TUint32 aKey, const TReal& aValue );
+
+    /**
+     * Sets the value of a binary key in the repository.
+     *
+     * @param   aUid        The UID of the repository.
+     * @param   aKey        The key within the repository.
+     * @param   aValue      The value to set.
+     */
+    IMPORT_C static void SetRepositoryValueL( const TUid& aUid, TUint32 aKey, const TDesC8& aValue );
+
+    /**
+     * Sets the value of a string key in the repository.
+     *
+     * @param   aUid        The UID of the repository.
+     * @param   aKey        The key within the repository.
+     * @param   aValue      The value to set.
+     */
+    IMPORT_C static void SetRepositoryValueL( const TUid& aUid, TUint32 aKey, const TDesC16& aValue );
+
+    /**
+     * Gets the value of an integer key in the repository.
+     *
+     * @param   aUid        The UID of the repository.
+     * @param   aKey        The key within the repository.
+     * @param   aValue      On return, the value of the key within the repository.
+     */
+    IMPORT_C static void GetRepositoryValueL( const TUid& aUid, TUint32 aKey, TInt& aValue );
+
+    /**
+     * Gets the value of a floating point key in the repository.
+     *
+     * @param   aUid        The UID of the repository.
+     * @param   aKey        The key within the repository.
+     * @param   aValue      On return, the value of the key within the repository.
+     */
+    IMPORT_C static void GetRepositoryValueL( const TUid& aUid, TUint32 aKey, TReal& aValue );
+
+    /**
+     * Gets the value of a binary key in the repository.
+     *
+     * @param   aUid        The UID of the repository.
+     * @param   aKey        The key within the repository.
+     * @param   aValue      On return, the value of the key within the repository.
+     */
+    IMPORT_C static void GetRepositoryValueL( const TUid& aUid, TUint32 aKey, TDes8& aValue );
+
+    /**
+     * Gets the value of a string key in the repository.
+     *
+     * @param   aUid        The UID of the repository.
+     * @param   aKey        The key within the repository.
+     * @param   aValue      On return, the value of the key within the repository.
+     */
+    IMPORT_C static void GetRepositoryValueL( const TUid& aUid, TUint32 aKey, TDes16& aValue );
+
+    };
+
+#endif // C_RADIOREPOSITORYMANAGER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/api/cradioroutableaudio.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,95 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef C_RADIOROUTABLEAUDIO_H
+#define C_RADIOROUTABLEAUDIO_H
+
+// System includes
+#include <e32base.h>
+
+// User includes
+#include "radioenginedef.h"
+
+// Forward declarations
+class CAudioOutput;
+class CRadioAudioRouter;
+
+/**
+ * CRadioRoutableAudio
+ *
+ * Defines common functionality for routable audio sources by defining common
+ * skeleton method for routing.
+ *
+ */
+class CRadioRoutableAudio : public CBase
+    {
+
+public:
+
+    IMPORT_C CRadioRoutableAudio( CRadioAudioRouter* aAudioRouter );
+
+    IMPORT_C ~CRadioRoutableAudio();
+
+    /**
+     * Sets audio routing. Please note that subclasses must define
+     * <code>RoutedAudio</code> method otherwise this will not do anything.
+     * @param aDestination 'Not documented'? old documentation: if <code>true</code> audio routing will be set to
+     * speaker otherwise to headset.
+     */
+    IMPORT_C void SetAudioRouteL( RadioEngine::TRadioAudioRoute aRoute );
+
+    /**
+     * Tells if audio routing is supported
+     * @return EFalse if routing is not supported, otherwise true
+     */
+    IMPORT_C TBool AudioRoutingSupported() const;
+
+protected:
+
+    /**
+     * Sets audio output. Must be called from subclass.
+     * Ownership is moved.
+     * @param aAudioOutput for setting routing.
+     */
+    IMPORT_C void SetAudioOutput( CAudioOutput* aAudioOutput );
+
+    /**
+     * Deletes audio output.
+     * Must be called from subclass before
+     * the actual audio utility class is deleted.
+     */
+    IMPORT_C void DeleteAudioOutput();
+
+protected: //data
+
+    /**
+     * Routes audio. Used to register/unregister this routable audio for routing.
+     * Own.
+     */
+    CRadioAudioRouter* iAudioRouter;
+
+private: // data
+
+    /**
+     * AudioOutput for setting routing.
+     * Own.
+     */
+    CAudioOutput*       iAudioOutput;
+
+    };
+
+#endif // C_RADIOROUTABLEAUDIO_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/api/cradiosystemeventcollector.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,91 @@
+/*
+* 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 CRADIOSYSTEMEVENTCOLLECTOR_H
+#define CRADIOSYSTEMEVENTCOLLECTOR_H
+
+#include <e32std.h>
+
+class MRadioSystemEventObserver;
+
+NONSHARABLE_CLASS( CRadioSystemEventCollector )
+    {
+public:
+
+    IMPORT_C static CRadioSystemEventCollector* NewL();
+
+    IMPORT_C virtual ~CRadioSystemEventCollector();
+
+    /**
+     * Adds a system event observer
+     *
+     * @param aSystemObserver The observer to be added
+     */
+    virtual void AddObserverL( MRadioSystemEventObserver* aSystemObserver ) = 0;
+
+    /**
+    * Removes a system event observer
+    *
+    * @param aSystemObserver The observer to be removed
+    */
+    virtual void RemoveObserver( MRadioSystemEventObserver* aSystemObserver ) = 0;
+
+    /**
+    * Returns data network coverage state ( wlan or mobile ).
+    *
+    * @return ETrue if there is network coverage
+    */
+    virtual TBool IsNetworkCoverage() const = 0;
+
+    /**
+    * Returns mobile network coverage state.
+    *
+    * @return ETrue if there is network coverage
+    */
+    virtual TBool IsMobileNetworkCoverage() const = 0;
+
+    /**
+    * Returns current call state.
+    *
+    * @return ETrue if call is active
+    */
+    virtual TBool IsCallActive() const = 0;
+
+    /**
+    * Returns current audio resources state.
+    *
+    * @return ETrue if audio resources are available
+    */
+    virtual TBool IsAudioResourcesAvailable() const = 0;
+
+    /**
+     * Returns current headset connection status
+     *
+     * @return
+     */
+    virtual TBool IsHeadsetConnectedL() const = 0;
+
+    /**
+     * Returns current Voice UI state.
+     *
+     * @return ETrue if Voice UI is active, EFalse otherwise
+     */
+    virtual TBool IsVoiceUiActive() const = 0;
+
+    };
+
+#endif // CRADIOSYSTEMEVENTCOLLECTOR_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/api/mradioaudioroutingobserver.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MRADIOAUDIOROUTINGOBSERVER_H
+#define MRADIOAUDIOROUTINGOBSERVER_H
+
+#include "radioenginedef.h"
+
+/**
+ *  Interface for observing audio routing events.
+ *
+ *  Implementer will be notified when audio routing changes
+ *  between IHF and headset.
+ *
+ */
+NONSHARABLE_CLASS( MRadioAudioRoutingObserver )
+    {
+public:
+
+    /**
+     * Notifies of a requested audio routing change. Changes requested
+     * by other applications do not generate a notification.
+     *
+     * @param aRoute Current audio route
+     */
+    virtual void AudioRouteChangedL( RadioEngine::TRadioAudioRoute aRoute ) = 0;
+
+    };
+
+#endif // MRADIOAUDIOROUTINGOBSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/api/mradiocontroleventobserver.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,192 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MRADIOCONTROLEVENTOBSERVER_H
+#define MRADIOCONTROLEVENTOBSERVER_H
+
+// System includes
+#include <e32std.h>
+
+// User includes
+#include "radioenginedef.h"
+
+/**
+ *  MRadioControlEventObserver
+ *
+ *  MRadioControlEventObserver defines observer interface for radio engine control events.
+ */
+NONSHARABLE_CLASS( MRadioControlEventObserver )
+    {
+public:
+
+    /**
+     * Called when "step to channel" request occurs.
+     *
+     * @param aDirection If ERadioUp steps up, otherwise steps down
+     */
+    virtual void StepToChannelL( RadioEngine::TRadioTuneDirection aDirection ) = 0;
+
+    /**
+     * Called when "set channel" request occurs.
+     *
+     * @param aChannelId Channel id to set
+     */
+    virtual void SetChannelL( TInt aChannelId ) = 0;
+
+    /**
+     * Called when "seek" request occurs.
+     *
+     * @param aDirection If ERadioUp seeks up, otherwise seeks down
+     */
+    virtual void SeekL( RadioEngine::TRadioTuneDirection aDirection ) = 0;
+
+    /**
+     * Called when "step to frequency up" request occurs.
+     *
+     * @param aDirection If ERadioUp steps up, otherwise steps down
+     */
+    virtual void StepToFrequencyL( RadioEngine::TRadioTuneDirection aDirection ) = 0;
+
+    /**
+     * Called when "set frequency" request occurs.
+     *
+     * @param aFreq Frequency to set
+     */
+    virtual void SetFrequencyL( TUint32 aFreq ) = 0;
+
+    /**
+     * Called when "adjust volume" request occurs.
+     *
+     * @param aDirection If ERadioDecVolume decreases, otherwise increases
+     * volume
+     */
+    virtual void AdjustVolumeL( RadioEngine::TRadioVolumeSetDirection aDirection ) = 0;
+
+    /**
+     * Called when "mute" request occurs.
+     *
+     * @param aMute if ETrue mutes, else unmutes radio
+     */
+    virtual void MuteL( TBool aMute ) = 0;
+
+    /**
+    * Called when "play" request occurs.
+    *
+    * @param aDownPressed If ETrue, button is down. If EFalse, button is up.
+    */
+    virtual void PlayL( TBool aDownPressed ) = 0;
+
+    /**
+     * Called when "pause" request occurs.
+     *
+     * @param aDownPressed If ETrue, button is down. If EFalse, button is up.
+     */
+    virtual void PauseL( TBool aDownPressed ) = 0;
+
+    /**
+     * Called when "play", "pause" or "pauseplay" request occurs.
+     *
+     * @param aDownPressed If ETrue, button is down. If EFalse, button is up.
+     */
+    virtual void PausePlayL( TBool aDownPressed ) = 0;
+
+    /**
+     * Called when "stop" request occurs.
+     *
+     * @param aDownPressed If ETrue, button is down. If EFalse, button is up.
+     */
+    virtual void StopL( TBool aDownPressed ) = 0;
+
+    /**
+     * Called when "forward" request occurs.
+     *
+     * @param aDownPressed If ETrue, button is down. If EFalse, button is up.
+     */
+    virtual void ForwardL( TBool aDownPressed ) = 0;
+
+    /**
+     * Called when "fast forward" request occurs.
+     *
+     * @param aDownPressed If ETrue, button is down. If EFalse, button is up.
+     */
+    virtual void FastForwardL( TBool aDownPressed ) = 0;
+
+    /**
+     * Called when "backward" request occurs.
+     *
+     * @param aDownPressed If ETrue, button is down. If EFalse, button is up.
+     */
+    virtual void BackwardL( TBool aDownPressed ) = 0;
+
+    /**
+     * Called when "rewind" request occurs.
+     *
+     * @param aDownPressed If ETrue, button is down. If EFalse, button is up.
+     */
+    virtual void RewindL( TBool aDownPressed ) = 0;
+
+    /**
+     * Called when "channel up" request occurs.
+     *
+     * @param aDownPressed If ETrue, button is down. If EFalse, button is up.
+     */
+    virtual void ChannelUpL( TBool aDownPressed ) = 0;
+
+    /**
+     * Called when "channel down" request occurs.
+     *
+     * @param aDownPressed If ETrue, button is down. If EFalse, button is up.
+     */
+    virtual void ChannelDownL( TBool aDownPressed ) = 0;
+
+    /**
+     * Called when "volume up" request occurs.
+     *
+     * @param aDownPressed If ETrue, button is down. If EFalse, button is up.
+     */
+    virtual void VolumeUpL( TBool aDownPressed ) = 0;
+
+    /**
+     * Called when "volume down" request occurs.
+     *
+     * @param aDownPressed If ETrue, button is down. If EFalse, button is up.
+     */
+    virtual void VolumeDownL( TBool aDownPressed ) = 0;
+
+    /**
+     * Called when "change view" request occurs
+     *
+     * @param aViewId the id of activated view
+     * @param aForceChange if ETrue, view changing is forced and state
+     * of visual radio is not checked
+     */
+    virtual void ChangeViewL( TUid aViewId, TBool aForceChange ) = 0;
+
+    /**
+     * Called when audio route is changed
+     * @param aRoute the current audio route
+     */
+    virtual void SetAudioRouteL( RadioEngine::TRadioAudioRoute aRoute ) = 0;
+
+    /**
+     * Called when headset button answer/end call is pressed
+     */
+    virtual void AnswerEndCallL() = 0;
+
+    };
+
+#endif // MRADIOCONTROLEVENTOBSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/api/mradioenginelogger.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,114 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef M_RADIOENGINELOGGER_H
+#define M_RADIOENGINELOGGER_H
+
+#include <e32std.h>
+
+_LIT( KMarkerEngine, "RadioEngine:" );
+_LIT( KMarkerUi,     "RadioUI:    " );
+
+/**
+ * Common interface for logger types.
+ */
+NONSHARABLE_CLASS( MRadioEngineLogger )
+    {
+
+public:
+
+    IMPORT_C static MRadioEngineLogger* Logger();
+
+    /**
+     * Clear the log.
+     */
+    virtual MRadioEngineLogger& ClearLog() = 0;
+
+    /**
+     * Adds a 8-bit string to log line
+     */
+    virtual MRadioEngineLogger& Add( const TDesC8& aMsg ) = 0;
+
+    /**
+     * Adds a 16-bit string to log line
+     */
+    virtual MRadioEngineLogger& Add( const TDesC& aMsg ) = 0;
+
+    /**
+     * Adds a TInt to log line
+     */
+    virtual MRadioEngineLogger& Add( TInt aInt ) = 0;
+
+    /**
+     * Adds a TReal to log line
+     */
+    virtual MRadioEngineLogger& Add( const TReal& aReal ) = 0;
+
+    /**
+     * Adds a c-style string to log line
+     */
+    virtual MRadioEngineLogger& Add( const char* aText ) = 0;
+
+    /**
+     * Adds a pointer value to log line
+     */
+    virtual MRadioEngineLogger& Add( const TAny* aPtr ) = 0;
+
+    /**
+     * Adds a timestamp of current time to log line
+     */
+    virtual MRadioEngineLogger& Add( const TTime& aTime ) = 0;
+
+    /**
+     * Adds a timestamp of current time to log line
+     */
+    virtual MRadioEngineLogger& AddTimestamp() = 0;
+
+    /**
+     * Adds a formatted string to log line
+     */
+    virtual MRadioEngineLogger& AddFormat( TRefByValue<const TDesC> aFmt, ... ) = 0;
+
+    /**
+     * Adds the line indentation to log line
+     */
+    virtual MRadioEngineLogger& AddIndent( const TDesC& aMarker ) = 0;
+
+    /**
+     * Adds the line indentation to log line
+     */
+    virtual MRadioEngineLogger& AddIndentClear( const TDesC& aMarker ) = 0;
+
+    /**
+     * Increment indentation
+     */
+    virtual MRadioEngineLogger& IncIndent() = 0;
+
+    /**
+     * Decrement indentation
+     */
+    virtual MRadioEngineLogger& DecIndent() = 0;
+
+    /**
+     * Commits the log line to file and RDebug and resets internal buffer
+     * @param aNewLine ETrue if newline is to be added, EFalse if not
+     */
+    virtual MRadioEngineLogger& Commit( TBool aNewLine = ETrue ) = 0;
+
+    };
+
+#endif // M_RADIOENGINELOGGER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/api/mradiorepositoryentityobserver.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,72 @@
+/*
+* 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 M_RADIOREPOSITORYENTITYOBSERVER_H
+#define M_RADIOREPOSITORYENTITYOBSERVER_H
+
+/**
+ * Entity observer interface.
+ */
+NONSHARABLE_CLASS( MRadioRepositoryEntityObserver )
+    {
+
+public:
+
+    /**
+     * Invoked when the observed entity's value is changed.
+     *
+     * @param   aUid        The UID of the entity.
+     * @param   aKey        The key of the entity.
+     * @param   aValue      The new value of the entity.
+     * @param   aError      One of the standard system error codes.
+     */
+    virtual void HandleRepositoryValueChangeL( const TUid& aUid, TUint32 aKey, TInt aValue, TInt aError ) = 0;
+
+    /**
+     * Invoked when the observed entity's value is changed.
+     *
+     * @param   aUid        The UID of the entity.
+     * @param   aKey        The key of the entity.
+     * @param   aValue      The new value of the entity.
+     * @param   aError      One of the standard system error codes.
+     */
+    virtual void HandleRepositoryValueChangeL( const TUid& aUid, TUint32 aKey, const TReal& aValue, TInt aError ) = 0;
+
+    /**
+     * Invoked when the observed entity's value is changed.
+     *
+     * @param   aUid        The UID of the entity.
+     * @param   aKey        The key of the entity.
+     * @param   aValue      The new value of the entity.
+     * @param   aError      One of the standard system error codes.
+     */
+    virtual void HandleRepositoryValueChangeL( const TUid& aUid, TUint32 aKey, const TDesC8& aValue, TInt aError ) = 0;
+
+    /**
+     * Invoked when the observed entity's value is changed.
+     *
+     * @param   aUid        The UID of the entity.
+     * @param   aKey        The key of the entity.
+     * @param   aValue      The new value of the entity.
+     * @param   aError      One of the standard system error codes.
+     */
+    virtual void HandleRepositoryValueChangeL( const TUid& aUid, TUint32 aKey, const TDesC16& aValue, TInt aError ) = 0;
+
+    };
+
+#endif // M_RADIOREPOSITORYENTITYOBSERVER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/api/mradiosystemeventobserver.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,59 @@
+/*
+* 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 MRADIOSYSTEMEVENTOBSERVER_H
+#define MRADIOSYSTEMEVENTOBSERVER_H
+
+// Data types
+
+/** Type of system event */
+enum TRadioSystemEventType
+    {
+    ERadioHeadsetConnected,         ///< Headset was connected
+    ERadioHeadsetDisconnected,      ///< Headset was disconnected
+    ERadioNetworkCoverageUp,        ///< Network coverage detected
+    ERadioNetworkCoverageDown,      ///< Network coverage lost
+    ERadioCallActivated,            ///< Call activated or ringing
+    ERadioCallDeactivated,          ///< Call disconnected
+    ERadioEmergencyCallActivated,   ///< Call activated or ringing
+    ERadioEmergencyCallDeactivated, ///< Call disconnected
+    ERadioLowDiskSpace,             ///< Low disk space
+    ERadioAudioRouteHeadset,        ///< Audio routed through headset
+    ERadioAudioRouteSpeaker,        ///< Audio routed through speaker ( IHF )
+    ERadioAudioResourcesAvailable,  ///< Audio resources have become available
+    ERadioAudioAutoResumeForbidden  ///< Audio auto resuming is forbidden
+    };
+
+
+/**
+ * Observer for any system event state change.
+ */
+NONSHARABLE_CLASS( MRadioSystemEventObserver )
+    {
+public:
+
+    /**
+     * Called when system event occurs.
+     * @param aEventType Type of the event
+     */
+    virtual void HandleSystemEventL( TRadioSystemEventType aEventType ) = 0;
+
+    };
+
+#endif // MRADIOSYSTEMEVENTOBSERVER_H
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/api/radioengine.hrh	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef RADIOENGINE_HRH
+#define RADIOENGINE_HRH
+
+/** Regions*/
+enum TRadioRegion
+    {
+    ERadioRegionNone = -1,
+    ERadioRegionDefault,
+    ERadioRegionJapan,
+    ERadioRegionAmerica,
+    ERadioRegionPoland
+    };
+
+#endif // RADIOENGINE_HRH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/api/radioenginedef.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,76 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef RADIOENGINEDEF_H_
+#define RADIOENGINEDEF_H_
+
+namespace RadioEngine
+    {
+
+    /**
+     * Output sources.
+     */
+    enum TRadioAudioRoute
+        {
+        ERadioHeadset = 0,  /**< Headset in use. */
+        ERadioSpeaker = 1   /**< Speaker in use. */
+        };
+
+    /** Direction of tuning */
+    enum TRadioTuneDirection
+        {
+        ERadioDown,
+        ERadioUp
+        };
+
+    /** Direction when setting the volume */
+    enum TRadioVolumeSetDirection
+        {
+        ERadioDecVolume,
+        ERadioIncVolume
+        };
+
+    /** Audio mode */
+    enum TRadioAudioMode
+        {
+        ERadioStereo = 0,
+        ERadioMono
+        };
+
+    /** Seeking state */
+    enum TRadioSeeking
+        {
+        ERadioNotSeeking,
+        ERadioSeekingUp,
+        ERadioSeekingDown,
+        };
+
+    enum TRadioFrequencyEventReason
+        {
+        ERadioFrequencyEventReasonUnknown,     // Default reason
+        ERadioFrequencyEventReasonNext,        // Step to next preset
+        ERadioFrequencyEventReasonPrevious,    // Step to previous preset
+        ERadioFrequencyEventReasonUp,          // Tune or step to higher frequency
+        ERadioFrequencyEventReasonDown,        // Tune or step to lower frequency
+        ERadioFrequencyEventReasonSeekUp,      // Seek to higher frequency
+        ERadioFrequencyEventReasonSeekDown,    // Seek to lower frequency
+        ERadioFrequencyEventReasonImplicit,    // Event originated by radio component
+        ERadioFrequencyEventReasonDummy        // Dummy event, doesn't cause any actions
+        };
+    }
+
+#endif // RADIOENGINEDEF_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/api/radioengineutils.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,82 @@
+/*
+* 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 RADIOENGINEUTILS_H
+#define RADIOENGINEUTILS_H
+
+// System includes
+#include <e32std.h>
+
+// User includes
+
+// Forward declarations
+class MRadioEngineLogger;
+class CCoeEnv;
+class RFs;
+
+/**
+ * System utility collection class.
+ */
+class RadioEngineUtils
+    {
+
+public:
+
+    IMPORT_C static void InitializeL( CCoeEnv* aCoeEnv = NULL );
+
+    IMPORT_C static void Release();
+
+    IMPORT_C static MRadioEngineLogger* Logger();
+
+    /**
+     * Return the cone environment
+     *
+     * @return Pointer to CCoeEnv
+     */
+    IMPORT_C static CCoeEnv* Env();
+
+    /**
+     * Returns the file server session
+     *
+     * @return Reference to file server session
+     */
+    IMPORT_C static RFs& FsSession();
+
+    /**
+     * Converts a frequency to a descriptor format.
+     * Returned descriptor is left in CleanupStack.
+     *
+     * @param   aFreq           Frequency, in kilohertz, to convert.
+     * @param   aDecimalCount   Decimal count to use.
+     * @param   aResourceId     Resource ID of the format string, or <code>KErrNotFound</code> if no such resource is to be used.
+     * @return  The formatted descriptor. Ownership is transferred.
+     */
+    IMPORT_C static HBufC* ReadFrequencyStringLC( TUint32 aFreq, TInt aDecimalCount, TInt aResourceId = KErrNotFound );
+
+    /**
+     * Writes formatted frequency to a give descriptor.
+     *
+     * @param   aDest           Destination descriptor.
+     * @param   aFreq           Frequency, in kilohertz, to convert.
+     * @param   aDecimalCount   Decimal count to use.
+     * @param   aFormat         Format read from resource.
+     */
+    IMPORT_C static void FormatFrequencyString( TDes& aDest, TUint32 aFreq, TInt aDecimalCount, TDesC& aFormat );
+
+    };
+
+#endif // RADIOENGINEUTILS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/api/radiointernalcrkeys.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,235 @@
+/*
+* 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 RADIOINTERNALCRKEYS_H
+#define RADIOINTERNALCRKEYS_H
+
+#include <e32cmn.h>
+
+/** The UID of the category we use. Must be the same as Visual Radio's UID3 ( SID ). */
+const TUid KRadioCRUid = { 0x101FF976 };
+
+/**
+* The service mode of Visual Radio.
+*
+* @see TVRCRServiceMode
+*/
+const TUint32 KRadioCRServiceMode = 0x00000000;
+
+/**
+* Possible Visual Radio service modes.
+*/
+enum TVRCRServiceMode
+    {
+    EVRCRServiceNone,   /**< Visual Radio has neither SDS nor visual service enabled. */
+    EVRCRServiceSds,    /**< Visual Radio has SDS service enabled. */
+    };
+
+/////////////////////////////////////////////////////////////////////////////////////
+// When adding a new key, add it also to CVRRepositoryManager::CheckRepositoryKeysL()
+// to make sure that SIS installation updates cenrep keys.
+/////////////////////////////////////////////////////////////////////////////////////
+
+// APPLICATION SETTINGS
+
+/** The base value for application setting keys. */
+const TUint32 KRadioCRApplicationSettingsBase                  = { 0x00000010 };
+
+/** The key associated with the active focus location setting. */
+const TUint32 KRadioCRActiveFocusLocation                      = { KRadioCRApplicationSettingsBase + 0x00000000 };
+
+/** Removed. Do not use. */
+const TUint32 KRadioCRRemoved1                                 = { KRadioCRApplicationSettingsBase + 0x00000001 };
+
+/** Removed. Do not use. */
+const TUint32 KRadioCRRemoved2                                 = { KRadioCRApplicationSettingsBase + 0x00000002 };
+
+/** The key associated with the http cache limit setting. */
+const TUint32 KRadioCRUiFlags                                  = { KRadioCRApplicationSettingsBase + 0x00000003 };
+
+/** Removed. Do not use. */
+const TUint32 KRadioCRRemoved3                                 = { KRadioCRApplicationSettingsBase + 0x00000004 };
+
+/** Removed. Do not use. */
+const TUint32 KRadioCRRemoved4                                 = { KRadioCRApplicationSettingsBase + 0x00000005 };
+
+/** Removed. Do not use. */
+const TUint32 KRadioCRRemoved5                                 = { KRadioCRApplicationSettingsBase + 0x00000006 };
+
+/** Removed. Do not use. */
+const TUint32 KRadioCRRemoved6                                 = { KRadioCRApplicationSettingsBase + 0x00000007 };
+
+/** Removed. Do not use. */
+const TUint32 KRadioCRRemoved7                                 = { KRadioCRApplicationSettingsBase + 0x0000000B };
+
+/** Removed. Do not use. */
+const TUint32 KRadioCRRemoved8                                 = { KRadioCRApplicationSettingsBase + 0x0000000C };
+
+/** Removed. Do not use. */
+const TUint32 KRadioCRRemoved9                                 = { KRadioCRApplicationSettingsBase + 0x0000000D };
+
+/** Removed. Do not use. */
+const TUint32 KRadioCRRemoved10                                = { KRadioCRApplicationSettingsBase + 0x0000000E };
+
+/** Removed. Do not use. */
+const TUint32 KRadioCRRemoved11                                = { KRadioCRApplicationSettingsBase + 0x0000000F };
+
+/* The key associated with the application launch count setting */
+const TUint32 KRadioCRLaunchCount                              = { KRadioCRApplicationSettingsBase + 0x00000010 };
+
+/* The key associated with the application offline mode usability. */
+const TUint32 KRadioCROfflineModeFunctionality                 = { KRadioCRApplicationSettingsBase + 0x00000011 };
+
+/** Removed. Do not use. */
+const TUint32 KRadioCRRemoved12                                = { KRadioCRApplicationSettingsBase + 0x00000012 };
+
+/* User audio history */
+const TUint32 KRadioCRAudioPlayHistory                         = { KRadioCRApplicationSettingsBase + 0x00000014 };
+
+
+/**
+* Removed. Do not use.
+*/
+enum TVRCRRemoved
+    {
+    EVRCRRemoved13,
+    EVRCRRemoved14
+    };
+
+
+// RADIO SETTINGS
+
+/** The base value for radio setting keys. */
+const TUint32 KRadioCRRadioSettingsBase                        = { 0x00000100 };
+
+/** The key associated with the headset volume setting. */
+const TUint32 KRadioCRHeadsetVolume                            = { KRadioCRRadioSettingsBase + 0x00000000 };
+
+/** The key associated with the speaker volume setting. */
+const TUint32 KRadioCRSpeakerVolume                            = { KRadioCRRadioSettingsBase + 0x00000001 };
+
+/** The key associated with the output mode setting. */
+const TUint32 KRadioCROutputMode                               = { KRadioCRRadioSettingsBase + 0x00000002 };
+
+/** The key associated with the audio route setting. */
+const TUint32 KRadioCRAudioRoute                               = { KRadioCRRadioSettingsBase + 0x00000003 };
+
+/** The key associated with the headset volume mute setting. */
+const TUint32 KRadioCRHeadsetMuteState                         = { KRadioCRRadioSettingsBase + 0x00000004 };
+
+/** The key associated with the speaker volume mute setting. */
+const TUint32 KRadioCRSpeakerMuteState                         = { KRadioCRRadioSettingsBase + 0x00000005 };
+
+/** The key associated with the radio power state. */
+const TUint32 KRadioCRVisualRadioPowerState                    = { KRadioCRRadioSettingsBase + 0x00000006 };
+
+/** The key associated with the tuned frequency setting.  */
+const TUint32 KRadioCRTunedFrequency                           = { KRadioCRRadioSettingsBase + 0x00000007 };
+
+/** The key associated with the default minimum volume level setting.  */
+const TUint32 KRadioCRDefaultMinVolumeLevel                    = { KRadioCRRadioSettingsBase + 0x00000008 };
+
+/** The key associated with the current region setting. */
+const TUint32 KRadioCRCurrentRegion                            = { KRadioCRRadioSettingsBase + 0x0000000A };
+
+/** Removed. Do not use. */
+const TUint32 KRadioCRRemoved15                                = { KRadioCRRadioSettingsBase + 0x0000000B };
+
+/** The key associated with the RDS support setting */
+const TUint32 KRadioCRRdsSupport                               = { KRadioCRRadioSettingsBase + 0x0000000C };
+
+/** The key associated with the alternate frequency search setting */
+const TUint32 KRadioCRRdsAfSearch                              = { KRadioCRRadioSettingsBase + 0x0000000D };
+
+/*** Region Japan allowed. */
+const TUint32 KRadioCRRegionAllowedJapan                       = { KRadioCRRadioSettingsBase + 0x0000000E };
+
+/*** Region America allowed. */
+const TUint32 KRadioCRRegionAllowedAmerica                     = { KRadioCRRadioSettingsBase + 0x0000000F };
+
+/*** Region Other allowed. */
+const TUint32 KRadioCRRegionAllowedDefault                     = { KRadioCRRadioSettingsBase + 0x00000010 };
+
+/*** Default region. */
+const TUint32 KRadioCRDefaultRegion                            = { KRadioCRRadioSettingsBase + 0x00000011 };
+
+
+// PRESET SETTINGS
+
+/** The base value for preset setting keys. */
+const TUint32 KRadioCRPresetSettingsBase                       = { 0x00001000 };
+
+/** The key associated with the maximum preset count setting. */
+const TUint32 KRadioCRPresetCount                              = { KRadioCRPresetSettingsBase + 0x00000000 };
+
+// CORE SETTINGS
+
+/** The base value for core setting keys. */
+const TUint32 KRadioCRCoreSettingsBase                         = { 0x00010000 };
+
+/** The key associated with the global name server address setting. */
+const TUint32 KRadioCRGlobalNameServer                         = { KRadioCRCoreSettingsBase + 0x00000000 };
+
+/** The key associated with the default global name server address setting. */
+const TUint32 KRadioCRDefaultGlobalNameServer                  = { KRadioCRCoreSettingsBase + 0x00000001 };
+
+/** The key associated with the local name server address setting. */
+const TUint32 KRadioCRLocalNameServer                          = { KRadioCRCoreSettingsBase + 0x00000002 };
+
+/** The key associated with the default local name server address setting. */
+const TUint32 KRadioCRDefaultLocalNameServer                   = { KRadioCRCoreSettingsBase + 0x00000003 };
+
+/** The key associated with the directory server url setting. */
+const TUint32 KRadioCRDirectoryServerUrl                       = { KRadioCRCoreSettingsBase + 0x00000004 };
+
+/** The key associated with the directory server base url setting. */
+const TUint32 KRadioCRDirectoryServerBaseUrl                   = { KRadioCRCoreSettingsBase + 0x00000005 };
+
+/** The key associated with the directory server country code setting. */
+const TUint32 KRadioCRDirectoryServerCountryCode               = { KRadioCRCoreSettingsBase + 0x00000006 };
+
+/** The key associated with the directory server network id setting. */
+const TUint32 KRadioCRDirectoryServerNetworkId                 = { KRadioCRCoreSettingsBase + 0x00000007 };
+
+/** The key associated with the default directory server url setting. */
+const TUint32 KRadioCRDefaultDirectoryServerUrl                = { KRadioCRCoreSettingsBase + 0x00000008 };
+
+/** The key associated with the default directory server base url setting. */
+const TUint32 KRadioCRDefaultDirectoryServerBaseUrl            = { KRadioCRCoreSettingsBase + 0x00000009 };
+
+/** The key associated with the internet access point setting. */
+const TUint32 KRadioCRInternetAccessPoint                      = { KRadioCRCoreSettingsBase + 0x0000000A };
+
+/** The key associated with the default internet access point setting. */
+const TUint32 KRadioCRDefaultInternetAccessPoint               = { KRadioCRCoreSettingsBase + 0x0000000B };
+
+/** The key associated with application id setting.  */
+const TUint32 KRadioCRApplicationId                            = { KRadioCRCoreSettingsBase + 0x0000000C };
+
+/** The key associated with the network id setting. */
+const TUint32 KRadioCRNetworkId                                = { KRadioCRCoreSettingsBase + 0x0000000D };
+
+/** The key associated with the subscriber id setting. */
+const TUint32 KRadioCRSubscriberId                             = { KRadioCRCoreSettingsBase + 0x0000000E };
+
+/** The key associated with the connection destination setting. */
+const TUint32 KRadioCRConnectionDestinationId                  = { KRadioCRCoreSettingsBase + 0x0000000F };
+
+/** The key associated with the country code setting. */
+const TUint32 KRadioCRCountryCode                              = { KRadioCRCoreSettingsBase + 0x00000010 };
+
+#endif // RADIOINTERNALCRKEYS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/api/radiointernalpskeys.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,354 @@
+/*
+* 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 RADIOINTERNALPSKEYS_H
+#define RADIOINTERNALPSKEYS_H
+
+#include <e32cmn.h>
+
+#include "radiouid.hrh"
+
+/**< The UID of the category we use. Must be the same as Visual Radio's UID3 ( SID ). */
+//TODO: Change
+const TUid KRadioPSUid = {0x101FF976};
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////
+///                                                                                                 ///
+/// Data properties. These properties are published by Visual Radio and used by other applications. ///
+///                                                                                                 ///
+///////////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+* Currently active channel's ID.
+* Value <code>KErrNone</code> means that no preset channel is active.
+* Type <code>RProperty::EInt</code>.
+*/
+const TUint32 KRadioPSDataChannel = 0x00000000;
+
+/**
+* Currently active frequency.
+* Frequency unit is in kHz.
+* Type <code>RProperty::EInt</code>.
+*/
+const TUint32 KRadioPSDataFrequency = 0x00000001;
+
+/**
+* Current power state of the radio.
+* Type <code>RProperty::EInt</code>.
+* @see TRadioRadioPowerState.
+*/
+const TUint32 KRadioPSDataRadioPowerState = 0x00000002;
+
+/**
+* Power state of the radio.
+*/
+enum TRadioPSRadioPowerState
+    {
+    ERadioPSRadioPowerStateUninitialized,  /**< The key is not yet initialized. */
+    ERadioPSRadioPowerOn,                    /**< Radio power on. */
+    ERadioPSRadioPowerOff                    /**< Radio power off. */
+    };
+
+/**
+* Current volume level.
+* Scale is from 1-10.
+* Type <code>RProperty::EInt</code>.
+*/
+const TUint32 KRadioPSDataVolume = 0x00000003;
+
+/**
+* Changing of this value means that channel
+* data of specified channel ID has changed.
+* The value remains indicating the last changed channel ID.
+* Value <code>KErrNone</code> means that no channel data has been changed yet.
+* Type <code>RProperty::EInt</code>.
+*/
+const TUint32 KRadioPSDataChannelDataChanged = 0x00000004;
+
+/**
+ * Removed. Do not use.
+ */
+const TUint32 KRadioPSDataRemoved = 0x00000005;
+
+/**
+* The current tuning state.
+* Type <code>RProperty::EInt</code>.
+* @see TRadioPSTuningState.
+*/
+const TUint32 KRadioPSDataTuningState = 0x00000006;
+
+/**
+* Possible tuning states.
+*/
+enum TRadioPSTuningState
+    {
+    ERadioPSTuningUninitialized,    /**< Currently not tuning. */
+    ERadioPSTuningStarted,             /**< Tuning has been started an lasted less than one second. */
+    ERadioPSTuningContinues         /**< Tuning has taken more than one second. */
+    };
+
+/**
+* Current mute state of radio.
+* Type <code>RProperty::EInt</code>.
+* @see TRadioPSRadioMuteState.
+*/
+const TUint32 KRadioPSDataRadioMuteState = 0x00000007;
+
+/**
+* Mute state of radio.
+*/
+enum TRadioPSRadioMuteState
+    {
+    ERadioPSMuteStateUninitialized,    /**< The key has not yet been initialized. */
+    ERadioPSMuteStateOn,               /**< Radio mute state is on. */
+    ERadioPSMuteStateOff               /**< Radio mute state is off. */
+    };
+
+/**
+* Indicates if Visual Radio is running or closing.
+* Type <code>RProperty::EInt</code>.
+* @see TRadioPSApplicationRunningState.
+*/
+const TUint32 KRadioPSDataApplicationRunning = 0x00000008;
+
+/**
+* Visual Radio application running states.
+*/
+enum TRadioPSApplicationRunningState
+    {
+    ERadioPSApplicationUninitialized,  /**< Visual Radio application's state is not yet initialized. */
+    ERadioPSApplicationRunning,        /**< Visual Radio application is running. */
+    ERadioPSApplicationClosing         /**< Visual Radio application is closing. */
+    };
+
+/**
+* Indicates the current headset connectivity status.
+* Type <code>RProperty::EInt</code>.
+* @see TRadioHeadsetStatus
+*/
+const TUint32 KRadioPSDataHeadsetStatus = 0x00000009;
+
+/**
+* Current headset status.
+*/
+enum TRadioPSHeadsetStatus
+    {
+    ERadioPSHeadsetUninitialized,  /**< The headset status is uninitialized. */
+    ERadioPSHeadsetDisconnected,   /**< The headset is disconnected. */
+    ERadioPSHeadsetConnected       /**< The headset is connected. */
+    };
+
+/**
+* The current frequency decimal count.
+* Type <code>RProperty::EInt</code>.
+* @see TRadioFrequencyDecimalCount.
+*/
+const TUint32 KRadioPSDataFrequencyDecimalCount = 0x00000010;
+
+/**
+* The current frequency decimal count.
+*/
+enum TRadioPSFrequencyDecimalCount
+    {
+    ERadioPSFrequencyDecimalCountUninitialized,    /**< Frequency decimal count has not yet been initialized. */
+    ERadioPSFrequencyOneDecimal,                     /**< Frequency accuracy is one decimal. */
+    ERadioPSFrequencyTwoDecimals,                    /**< Frequency accuracy is two decimals. */
+    ERadioPSFrequencyThreeDecimals                   /**< Frequency accuracy is three decimals. */
+    };
+
+/**
+* Removed. Do not use.
+*/
+const TUint32 KRadioPSRemoved1 = 0x00000014;
+
+/**
+* Flag to indicate if loudspeaker is in use
+*/
+const TUint32 KRadioPSDataLoudspeakerStatus = 0x00000015;
+/**
+* Current speaker status.
+*/
+enum TRadioPSLoudspeakerStatus
+    {
+    ERadioPSLoudspeakerUninitialized,  /**< The speaker status is uninitialized. */
+    ERadioPSLoudspeakerNotInUse,   /**< The speaker is not in use. */
+    ERadioPSLoudpeakerInUse       /**< The speaker is in use. */
+    };
+
+/**
+* Rds Program Service information, property type is text.
+*/
+const TUint32 KRadioPSDataRdsProgramService = 0x00000016;
+
+/**
+* Rds Radio Text information.
+* Type <code>RProperty::EText</code>.
+*/
+const TUint32 KRadioPSDataRdsRadioText = 0x00000017;
+
+/**
+ * Name of the current channel.
+ * Type <code>RProperty::EText</code>.
+ */
+const TUint32 KRadioPSDataChannelName = 0x00000018;
+
+/**
+* The amount of presets in active preset list.
+* In situations where the amount is undefined, value KErrNotFound
+* is used.
+* Type <code>RProperty::EInt</code>.
+*/
+const TUint32 KRadioPSDataActivePresetListCount = 0x00000019;
+
+/**
+* The active focus in active preset list.
+* In situations where the amount is undefined, value KErrNotFound
+* is used.
+* Type <code>RProperty::EInt</code>.
+*/
+const TUint32 KRadioPSDataActivePresetListFocus = 0x00000020;
+
+/**
+ * Current antenna state of the radio.
+ * Type <code>RProperty::EInt</code>.
+ * @see TRadioRadioAntennaState.
+ */
+const TUint32 KRadioPSDataRadioAntennaState = 0x00000021;
+
+/**
+* Power state of the radio.
+*/
+enum TRadioPSRadioAntennaState
+    {
+    ERadioPSRadioAntennaStateUninitialized,  /**< The key is not yet initialized. */
+    ERadioPSRadioAntennaAttached,            /**< Antenna attached. */
+    ERadioPSRadioAntennaDetached             /**< Antenna detached. */
+    };
+
+//////////////////////////////////////////////////////////////////////////////////////////////////////////
+///                                                                                                    ///
+/// Control properties. These properties are published by other applications and used by Visual Radio. ///
+///                                                                                                    ///
+//////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+* Steps up or down a channel in channel list.
+* Type <code>RProperty::EInt</code>.
+* @see TRadioPSStepToChannel.
+*/
+const TUint32 KRadioPSControlStepToChannel = 0x00001000;
+
+/**
+* Step direction of channel step.
+*/
+enum TRadioPSStepToChannel
+    {
+    ERadioPSStepToChannelUninitialized,    /**< Value of the key has not yet been initialized. */
+    ERadioPSStepToChannelUp,                /**< Step to next channel up. */
+    ERadioPSStepToChannelDown                /**< Step to next channel down. */
+    };
+
+/**
+* Switches to the specified channel ID.
+* Visual Radio ignores channel IDs that are out of scope.
+* Type <code>RProperty::EInt</code>.
+*/
+const TUint32 KRadioPSControlSetChannel = 0x00001001;
+
+/**
+* Seeks to next active frequency up or down.
+* Type <code>RProperty::EInt</code>.
+* @see TRadioPSSeek.
+*/
+const TUint32 KRadioPSControlSeek = 0x00001002;
+
+/**
+* Seek direction.
+*/
+enum TRadioPSSeek
+    {
+    ERadioPSSeekUninitialized, /**< Value of the key has not yet been initialized. */
+    ERadioPSSeekUp,            /**< Seek up. */
+    ERadioPSSeekDown            /**< Seek down. */
+    };
+
+/**
+* Steps up or down frequency, using the frequency step that is defined in radio.
+* Type <code>RProperty::EInt</code>.
+* @see TRadioPSStepToFrequency.
+*/
+const TUint32 KRadioPSControlStepToFrequency = 0x00001003;
+
+/**
+* Frequency step direction.
+*/
+enum TRadioPSStepToFrequency
+    {
+    ERadioPSStepToFrequencyUninitialized,  /**< The key has not yet been initialized. */
+    ERadioPSStepToFrequencyUp,                /**< Step up a frequency. */
+    ERadioPSStepToFrequencyDown            /**< Step down a frequency. */
+    };
+
+/**
+* Switches to specified frequency.
+* Frequency unit is kHz.
+* Type <code>RProperty::EInt</code>.
+*/
+const TUint32 KRadioPSControlSetFrequency = 0x00001004;
+
+/**
+* Increases or decreases volume level.
+* Type <code>RProperty::EInt</code>.
+* @see TRadioPSAdjustVolume.
+*/
+const TUint32 KRadioPSControlAdjustVolume = 0x00001005;
+
+/**
+* Volume step direction.
+*/
+enum TRadioPSAdjustVolume
+    {
+    ERadioPSAdjustVolumeUninitialized = 0, /**< The key has not yet been initialized. */
+    ERadioPSIncreaseVolume,                /**< Increase volume. */
+    ERadioPSDecreaseVolume                    /**< Decrease volume. */
+    };
+
+/**
+* Sets mute state on or off.
+* Type <code>RProperty::EInt</code>.
+* @see TRadioPSRadioMuteState.
+*/
+const TUint32 KRadioPSControlSetRadioMuteState = 0x00001006;
+
+/**
+* Sets the output source
+* Type <code>RProperty::EInt</code>.
+* @see TRadioPSAudioOutput
+*/
+const TUint32 KRadioPSControlSetAudioOutput = 0x00001008;
+
+/**
+ * Audio output target.
+ */
+enum TRadioPSAudioOutput
+    {
+    ERadioPSAudioOutputUninitialized = 0,   /**< The key has not yet been initialized. */
+    ERadioPSAudioOutputHeadset,             /**< Headset in use. */
+    ERadioPSAudioOutputSpeaker              /**< Speaker in use. */
+    };
+
+#endif // RADIOINTERNALPSKEYS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/api/radiouid.hrh	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,24 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef RADIOUID_HRH
+#define RADIOUID_HRH
+
+//TODO: Get uid. this is from visual radio
+#define KUidRadioApplication 0x101FF976
+
+#endif // RADIOUID_HRH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/bwins/radioengineutilsu.def	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,43 @@
+EXPORTS
+	??0CRadioRoutableAudio@@QAE@PAVCRadioAudioRouter@@@Z @ 1 NONAME ; CRadioRoutableAudio::CRadioRoutableAudio(class CRadioAudioRouter *)
+	??0TRadioMethodLogger@@QAE@PBG0@Z @ 2 NONAME ; TRadioMethodLogger::TRadioMethodLogger(unsigned short const *, unsigned short const *)
+	??1CRadioAudioRouter@@UAE@XZ @ 3 NONAME ; CRadioAudioRouter::~CRadioAudioRouter(void)
+	??1CRadioPubSub@@UAE@XZ @ 4 NONAME ; CRadioPubSub::~CRadioPubSub(void)
+	??1CRadioRepositoryManager@@UAE@XZ @ 5 NONAME ; CRadioRepositoryManager::~CRadioRepositoryManager(void)
+	??1CRadioRoutableAudio@@UAE@XZ @ 6 NONAME ; CRadioRoutableAudio::~CRadioRoutableAudio(void)
+	??1CRadioSystemEventCollector@@UAE@XZ @ 7 NONAME ; CRadioSystemEventCollector::~CRadioSystemEventCollector(void)
+	??1TRadioMethodLogger@@QAE@XZ @ 8 NONAME ; TRadioMethodLogger::~TRadioMethodLogger(void)
+	?ActivateL@CRadioPropertyObserver@@QAEXXZ @ 9 NONAME ; void CRadioPropertyObserver::ActivateL(void)
+	?AudioRoutingSupported@CRadioRoutableAudio@@QBEHXZ @ 10 NONAME ; int CRadioRoutableAudio::AudioRoutingSupported(void) const
+	?DeleteAudioOutput@CRadioRoutableAudio@@IAEXXZ @ 11 NONAME ; void CRadioRoutableAudio::DeleteAudioOutput(void)
+	?Env@RadioEngineUtils@@SAPAVCCoeEnv@@XZ @ 12 NONAME ; class CCoeEnv * RadioEngineUtils::Env(void)
+	?FormatFrequencyString@RadioEngineUtils@@SAXAAVTDes16@@KHAAVTDesC16@@@Z @ 13 NONAME ; void RadioEngineUtils::FormatFrequencyString(class TDes16 &, unsigned long, int, class TDesC16 &)
+	?FsSession@RadioEngineUtils@@SAAAVRFs@@XZ @ 14 NONAME ; class RFs & RadioEngineUtils::FsSession(void)
+	?GetRepositoryValueL@CRadioRepositoryManager@@SAXABVTUid@@KAAH@Z @ 15 NONAME ; void CRadioRepositoryManager::GetRepositoryValueL(class TUid const &, unsigned long, int &)
+	?GetRepositoryValueL@CRadioRepositoryManager@@SAXABVTUid@@KAAN@Z @ 16 NONAME ; void CRadioRepositoryManager::GetRepositoryValueL(class TUid const &, unsigned long, double &)
+	?GetRepositoryValueL@CRadioRepositoryManager@@SAXABVTUid@@KAAVTDes16@@@Z @ 17 NONAME ; void CRadioRepositoryManager::GetRepositoryValueL(class TUid const &, unsigned long, class TDes16 &)
+	?GetRepositoryValueL@CRadioRepositoryManager@@SAXABVTUid@@KAAVTDes8@@@Z @ 18 NONAME ; void CRadioRepositoryManager::GetRepositoryValueL(class TUid const &, unsigned long, class TDes8 &)
+	?InitializeL@RadioEngineUtils@@SAXPAVCCoeEnv@@@Z @ 19 NONAME ; void RadioEngineUtils::InitializeL(class CCoeEnv *)
+	?Logger@MRadioEngineLogger@@SAPAV1@XZ @ 20 NONAME ; class MRadioEngineLogger * MRadioEngineLogger::Logger(void)
+	?Logger@RadioEngineUtils@@SAPAVMRadioEngineLogger@@XZ @ 21 NONAME ; class MRadioEngineLogger * RadioEngineUtils::Logger(void)
+	?NewL@CRadioAudioRouter@@SAPAV1@AAVMRadioAudioRoutingObserver@@@Z @ 22 NONAME ; class CRadioAudioRouter * CRadioAudioRouter::NewL(class MRadioAudioRoutingObserver &)
+	?NewL@CRadioPropertyObserver@@SAPAV1@AAVMRadioPropertyChangeObserver@@ABVTUid@@IW4TRadioPropertyType@1@@Z @ 23 NONAME ; class CRadioPropertyObserver * CRadioPropertyObserver::NewL(class MRadioPropertyChangeObserver &, class TUid const &, unsigned int, enum CRadioPropertyObserver::TRadioPropertyType)
+	?NewL@CRadioPubSub@@SAPAV1@XZ @ 24 NONAME ; class CRadioPubSub * CRadioPubSub::NewL(void)
+	?NewL@CRadioRemConTarget@@SAPAV1@XZ @ 25 NONAME ; class CRadioRemConTarget * CRadioRemConTarget::NewL(void)
+	?NewL@CRadioRepositoryManager@@SAPAV1@H@Z @ 26 NONAME ; class CRadioRepositoryManager * CRadioRepositoryManager::NewL(int)
+	?NewL@CRadioSystemEventCollector@@SAPAV1@XZ @ 27 NONAME ; class CRadioSystemEventCollector * CRadioSystemEventCollector::NewL(void)
+	?ReadFrequencyStringLC@RadioEngineUtils@@SAPAVHBufC16@@KHH@Z @ 28 NONAME ; class HBufC16 * RadioEngineUtils::ReadFrequencyStringLC(unsigned long, int, int)
+	?RegisterRoutableAudio@CRadioAudioRouter@@QAEXPAVCRadioRoutableAudio@@@Z @ 29 NONAME ; void CRadioAudioRouter::RegisterRoutableAudio(class CRadioRoutableAudio *)
+	?Release@RadioEngineUtils@@SAXXZ @ 30 NONAME ; void RadioEngineUtils::Release(void)
+	?SetAudioOutput@CRadioRoutableAudio@@IAEXPAVCAudioOutput@@@Z @ 31 NONAME ; void CRadioRoutableAudio::SetAudioOutput(class CAudioOutput *)
+	?SetAudioRouteL@CRadioAudioRouter@@QAEXW4TRadioAudioRoute@RadioEngine@@@Z @ 32 NONAME ; void CRadioAudioRouter::SetAudioRouteL(enum RadioEngine::TRadioAudioRoute)
+	?SetAudioRouteL@CRadioRoutableAudio@@QAEXW4TRadioAudioRoute@RadioEngine@@@Z @ 33 NONAME ; void CRadioRoutableAudio::SetAudioRouteL(enum RadioEngine::TRadioAudioRoute)
+	?SetRepositoryValueL@CRadioRepositoryManager@@SAXABVTUid@@KABN@Z @ 34 NONAME ; void CRadioRepositoryManager::SetRepositoryValueL(class TUid const &, unsigned long, double const &)
+	?SetRepositoryValueL@CRadioRepositoryManager@@SAXABVTUid@@KABVTDesC16@@@Z @ 35 NONAME ; void CRadioRepositoryManager::SetRepositoryValueL(class TUid const &, unsigned long, class TDesC16 const &)
+	?SetRepositoryValueL@CRadioRepositoryManager@@SAXABVTUid@@KABVTDesC8@@@Z @ 36 NONAME ; void CRadioRepositoryManager::SetRepositoryValueL(class TUid const &, unsigned long, class TDesC8 const &)
+	?SetRepositoryValueL@CRadioRepositoryManager@@SAXABVTUid@@KH@Z @ 37 NONAME ; void CRadioRepositoryManager::SetRepositoryValueL(class TUid const &, unsigned long, int)
+	?UnRegisterRoutableAudio@CRadioAudioRouter@@QAEXPAVCRadioRoutableAudio@@@Z @ 38 NONAME ; void CRadioAudioRouter::UnRegisterRoutableAudio(class CRadioRoutableAudio *)
+	?ValueDes8@CRadioPropertyObserver@@QBEABVTDesC8@@XZ @ 39 NONAME ; class TDesC8 const & CRadioPropertyObserver::ValueDes8(void) const
+	?ValueDes@CRadioPropertyObserver@@QBEABVTDesC16@@XZ @ 40 NONAME ; class TDesC16 const & CRadioPropertyObserver::ValueDes(void) const
+	?ValueInt@CRadioPropertyObserver@@QBEHXZ @ 41 NONAME ; int CRadioPropertyObserver::ValueInt(void) const
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/eabi/radioengineutilsu.def	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,60 @@
+EXPORTS
+	_ZN12CRadioPubSub4NewLEv @ 1 NONAME
+	_ZN12CRadioPubSubD0Ev @ 2 NONAME
+	_ZN12CRadioPubSubD1Ev @ 3 NONAME
+	_ZN12CRadioPubSubD2Ev @ 4 NONAME
+	_ZN16RadioEngineUtils11InitializeLEP7CCoeEnv @ 5 NONAME
+	_ZN16RadioEngineUtils21FormatFrequencyStringER6TDes16miR7TDesC16 @ 6 NONAME
+	_ZN16RadioEngineUtils21ReadFrequencyStringLCEmii @ 7 NONAME
+	_ZN16RadioEngineUtils3EnvEv @ 8 NONAME
+	_ZN16RadioEngineUtils6LoggerEv @ 9 NONAME
+	_ZN16RadioEngineUtils7ReleaseEv @ 10 NONAME
+	_ZN16RadioEngineUtils9FsSessionEv @ 11 NONAME
+	_ZN17CRadioAudioRouter14SetAudioRouteLEN11RadioEngine16TRadioAudioRouteE @ 12 NONAME
+	_ZN17CRadioAudioRouter21RegisterRoutableAudioEP19CRadioRoutableAudio @ 13 NONAME
+	_ZN17CRadioAudioRouter23UnRegisterRoutableAudioEP19CRadioRoutableAudio @ 14 NONAME
+	_ZN17CRadioAudioRouter4NewLER26MRadioAudioRoutingObserver @ 15 NONAME
+	_ZN17CRadioAudioRouterD0Ev @ 16 NONAME
+	_ZN17CRadioAudioRouterD1Ev @ 17 NONAME
+	_ZN17CRadioAudioRouterD2Ev @ 18 NONAME
+	_ZN18CRadioRemConTarget4NewLEv @ 19 NONAME
+	_ZN18MRadioEngineLogger6LoggerEv @ 20 NONAME
+	_ZN18TRadioMethodLoggerC1EPKtS1_ @ 21 NONAME
+	_ZN18TRadioMethodLoggerC2EPKtS1_ @ 22 NONAME
+	_ZN18TRadioMethodLoggerD1Ev @ 23 NONAME
+	_ZN18TRadioMethodLoggerD2Ev @ 24 NONAME
+	_ZN19CRadioRoutableAudio14SetAudioOutputEP12CAudioOutput @ 25 NONAME
+	_ZN19CRadioRoutableAudio14SetAudioRouteLEN11RadioEngine16TRadioAudioRouteE @ 26 NONAME
+	_ZN19CRadioRoutableAudio17DeleteAudioOutputEv @ 27 NONAME
+	_ZN19CRadioRoutableAudioC1EP17CRadioAudioRouter @ 28 NONAME
+	_ZN19CRadioRoutableAudioC2EP17CRadioAudioRouter @ 29 NONAME
+	_ZN19CRadioRoutableAudioD0Ev @ 30 NONAME
+	_ZN19CRadioRoutableAudioD1Ev @ 31 NONAME
+	_ZN19CRadioRoutableAudioD2Ev @ 32 NONAME
+	_ZN22CRadioPropertyObserver4NewLER28MRadioPropertyChangeObserverRK4TUidjNS_18TRadioPropertyTypeE @ 33 NONAME
+	_ZN22CRadioPropertyObserver9ActivateLEv @ 34 NONAME
+	_ZN23CRadioRepositoryManager19GetRepositoryValueLERK4TUidmR5TDes8 @ 35 NONAME
+	_ZN23CRadioRepositoryManager19GetRepositoryValueLERK4TUidmR6TDes16 @ 36 NONAME
+	_ZN23CRadioRepositoryManager19GetRepositoryValueLERK4TUidmRd @ 37 NONAME
+	_ZN23CRadioRepositoryManager19GetRepositoryValueLERK4TUidmRi @ 38 NONAME
+	_ZN23CRadioRepositoryManager19SetRepositoryValueLERK4TUidmRK6TDesC8 @ 39 NONAME
+	_ZN23CRadioRepositoryManager19SetRepositoryValueLERK4TUidmRK7TDesC16 @ 40 NONAME
+	_ZN23CRadioRepositoryManager19SetRepositoryValueLERK4TUidmRKd @ 41 NONAME
+	_ZN23CRadioRepositoryManager19SetRepositoryValueLERK4TUidmi @ 42 NONAME
+	_ZN23CRadioRepositoryManager4NewLEi @ 43 NONAME
+	_ZN23CRadioRepositoryManagerD0Ev @ 44 NONAME
+	_ZN23CRadioRepositoryManagerD1Ev @ 45 NONAME
+	_ZN23CRadioRepositoryManagerD2Ev @ 46 NONAME
+	_ZN26CRadioSystemEventCollector4NewLEv @ 47 NONAME
+	_ZN26CRadioSystemEventCollectorD0Ev @ 48 NONAME
+	_ZN26CRadioSystemEventCollectorD1Ev @ 49 NONAME
+	_ZN26CRadioSystemEventCollectorD2Ev @ 50 NONAME
+	_ZNK19CRadioRoutableAudio21AudioRoutingSupportedEv @ 51 NONAME
+	_ZNK22CRadioPropertyObserver8ValueDesEv @ 52 NONAME
+	_ZNK22CRadioPropertyObserver8ValueIntEv @ 53 NONAME
+	_ZNK22CRadioPropertyObserver9ValueDes8Ev @ 54 NONAME
+	_ZTI15CRadioEngineTls @ 55 NONAME ; #<TI>#
+	_ZTI19CRadioRoutableAudio @ 56 NONAME ; #<TI>#
+	_ZTV15CRadioEngineTls @ 57 NONAME ; #<VT>#
+	_ZTV19CRadioRoutableAudio @ 58 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/group/bld.inf	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "../../group/buildflags.hrh"
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+WINSCW ARMV5
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
+radioengineutils.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/group/radioengineutils.mmp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "../../group/buildflags.hrh"
+
+#include <platform_paths.hrh>
+
+#include <data_caging_paths.hrh>
+
+TARGET                  radioengineutils.dll
+TARGETTYPE              DLL
+UID                     0x1000008D 0x10281CB8
+VERSION                 10.0
+
+CAPABILITY              CAP_GENERAL_DLL
+VENDORID                VID_DEFAULT
+PAGED
+
+USERINCLUDE             ../api
+USERINCLUDE             ../inc
+
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE           /epoc32/include/remcon
+SYSTEMINCLUDE           /epoc32/include/internal
+SYSTEMINCLUDE           /epoc32/include/mmf/common
+SYSTEMINCLUDE           /epoc32/include/platform/mw
+
+SOURCEPATH              ../src
+SOURCE                  radioengineutils.cpp
+SOURCE                  cradioenginetls.cpp
+SOURCE                  cradioroutableaudio.cpp
+SOURCE                  cradioaudiorouter.cpp
+SOURCE                  cradioaccessoryobserver.cpp
+SOURCE                  cradiopropertyobserver.cpp
+SOURCE                  cradiopubsub.cpp
+SOURCE                  cradiopubsubimp.cpp
+SOURCE                  cradioremcontarget.cpp
+SOURCE                  cradioremcontargetimp.cpp
+SOURCE                  cradiorepositoryentitybase.cpp
+SOURCE                  cradiorepositorymanager.cpp
+SOURCE                  cradiorepositorymanagerimp.cpp
+SOURCE                  cradiosystemeventdetector.cpp
+SOURCE                  cradiosystemeventcollector.cpp
+SOURCE                  cradiosystemeventcollectorimp.cpp
+SOURCE                  cradioenginelogger.cpp
+
+LIBRARY                 bafl.lib
+LIBRARY                 accclient.lib
+LIBRARY                 accpolicy.lib
+LIBRARY                 centralrepository.lib
+LIBRARY                 CommonEngine.lib
+LIBRARY                 efsrv.lib
+LIBRARY                 euser.lib
+LIBRARY                 cone.lib
+LIBRARY                 remconcoreapi.lib
+LIBRARY                 remconextensionapi.lib
+LIBRARY                 remconinterfacebase.lib
+LIBRARY                 featmgr.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/inc/cradioaccessoryobserver.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,170 @@
+/*
+* 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 CRADIOACCESSORYOBSERVER_H
+#define CRADIOACCESSORYOBSERVER_H
+
+#include <AccessoryServer.h>
+#include <AccessoryConnection.h>
+#include <AccPolSubblockNameArray.h>
+
+class MRadioHeadsetEventObserver;
+
+/**
+ *  Observer of accessory states.
+ *
+ *  Instance of this class observes notifications of headset state changes.
+ *  In its turn it sends notifications to its observer of those changes.
+ *
+ */
+NONSHARABLE_CLASS( CRadioAccessoryObserver ): public CActive
+    {
+public:
+
+    /**
+     * C++ default constructor.
+     */
+    CRadioAccessoryObserver();
+
+    /**
+     * Static constructor.
+     */
+    static CRadioAccessoryObserver* NewL();
+
+    /**
+     * Destructor.
+     */
+    virtual ~CRadioAccessoryObserver();
+
+    /**
+     * Sets observer. The observer will be notified when headset has been
+     * pressed or headset is connected/disconnected.
+      *
+     * @param aObserver Observer
+     */
+    void SetObserver( MRadioHeadsetEventObserver* aObserver );
+
+    /**
+     * Tells if there is a headset connected.
+     *
+     * @return <code>ETrue </code> if headset accessory is connected,
+     * <code>EFalse</code> otherwise
+     */
+    TBool IsHeadsetConnectedL() const;
+
+// from base class CActive
+    /**
+     * From CActive
+     *
+     * @see CActive::RunL()
+     */
+    void RunL();
+
+    /**
+     * From CActive
+     *
+     * @see CActive::DoCancel()
+     */
+    void DoCancel();
+
+private:
+
+    /**
+     * Finds an accessory. All wired and bluetooth accessories are taken into account.
+     *
+     * @param aAcceptOnlyHeadset If ETrue, search is succesful only if there is a headset connected.
+     * @param aOutputType The output type of the found accessory ( private/public )
+     * @return ETrue, if suitable accessory was found, EFalse otherwise
+     */
+    TBool FindAccessoryL( TBool aAcceptOnlyHeadset, TAccAudioOutPutType& aOutputType ) const;
+
+    /**
+     * Tells whether the given accessory is a lineout ( and not a headset ).
+     *
+     * @param aAccPolGenId The accessory being investigated.
+     * @return ETrue if the accessory is a lineout, EFalse otherwise.
+     */
+    TBool IsLineoutConnectedL( TAccPolGenericID& aAccPolGenId ) const;
+
+private:
+
+    /**
+     * By default Symbian 2nd phase constructor is private.
+     *
+     * @param aAccessoryServer Existing session for The Accessory Server.
+     */
+    void ConstructL();
+
+private:
+
+    /**
+     * Updates the set of known accessories.
+     * Method also informs the caller about added/removed accessories.
+     *
+     * @param aNroChangedAccessories On return contains the number of added/removed accessories.
+     */
+    void UpdateCurrentAccessoriesL( TInt& aNroChangedAccessories );
+
+    /**
+     * Counts the removed accessories.
+     *
+     * @return The number of removed accessories.
+     */
+    TInt CountRemovedAccessoriesL() const;
+
+    /**
+     * Counts the added accessories.
+     *
+     * @return The number of added accessories.
+     */
+    TInt CountAddedAccessoriesL() const;
+
+private:
+
+    /**
+     * Instance that gets notifications of the headset state changes
+     * Not owned.
+     */
+    MRadioHeadsetEventObserver* iObserver;
+
+    /**
+     * Session for The Accessory Server.
+     * Owned.
+     */
+    RAccessoryServer iAccessoryServer;
+
+    /**
+     * Accessory Connection.
+     * Owned.
+     */
+    RAccessoryConnection iAccessoryConn;
+
+    /**
+     * Known set of accessories. CRadioAccessoryObserver uses this set to deduce
+     * which accessory has been removed ( or added ) and whether or not it was an acceptable accessory.
+     * Owned.
+     */
+    RArray<TAccPolGenericID> iSavedAccessories;
+
+    /**
+     * Array of connected accessories.
+     */
+    TAccPolGenericIDArray iAccPolGenIdArr;
+
+    };
+
+#endif // CRADIOACCESSORYOBSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/inc/cradioenginetls.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,122 @@
+/*
+* 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 C_RADIOENGINETLS_H
+#define C_RADIOENGINETLS_H
+
+#include <e32base.h>
+
+class MRadioEngineLogger;
+class CCoeEnv;
+class RFs;
+
+/**
+ * TLS handler
+ */
+class CRadioEngineTls : public CBase
+    {
+
+friend class RadioEngineUtils;
+
+public:
+
+    /**
+     * Returns the CRadioEngineTls instance from TLS
+     *
+     * @since Live TV UI v1.0
+     * @return Reference to CRadioEngineTls instance
+     */
+    static CRadioEngineTls& Instance();
+
+    /**
+     * Return the logger storage if logging is enabled
+     *
+     * @since Live TV UI v1.0
+     */
+    static MRadioEngineLogger* Logger();
+
+    /**
+     * Return the eikon environment
+     *
+     * @since Live TV UI v1.0
+     * @return Pointer to CEikonEnv
+     */
+    static CCoeEnv* Env();
+
+    /**
+     * Returns the file server session
+     *
+     * @since Live TV UI v1.0
+     * @return Reference to file server session
+     */
+    static RFs& FsSession();
+
+    /**
+     * Increase reference count
+     */
+    void AddRef();
+
+    /**
+     * Decrease reference count
+     * Deletes self when ref count reaches zero.
+     */
+    void Release();
+
+private:
+
+    static void InitializeL( CCoeEnv* aEnv = NULL, RFs* aFs = NULL );
+
+    CRadioEngineTls( CCoeEnv* aEnv, RFs* aFs );
+
+    ~CRadioEngineTls();
+
+    void ConstructL();
+
+#ifdef LOGGING_ENABLED
+    /**
+     * File logger
+     * Own.
+     */
+    CRadioEngineLogger* iLogger;
+#endif
+
+    /**
+     * Pointer to the eikon environment
+     * Not own.
+     */
+    CCoeEnv*    iEnv;
+
+    /**
+     * Flag to indicate whether or not the file server session is owned
+     */
+    TBool       iFsOwned;
+
+    /**
+     * File server session.
+     * Own status determined by iFsOwned member variable
+     */
+    RFs*        iFs;
+
+    /**
+     * Reference count
+     */
+    TInt        iRefs;
+
+    };
+
+#endif // C_RADIOENGINETLS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/inc/cradiopropertyobserver.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,244 @@
+/*
+* 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 CRADIOPROPERTYOBSERVER_H
+#define CRADIOPROPERTYOBSERVER_H
+
+#include <e32base.h>
+#include <e32property.h>
+
+/**
+ * MRadioPropertyChangeObserver
+ *
+ * Abstract interface for handling property change events.
+ */
+class MRadioPropertyChangeObserver
+{
+
+public:
+
+    /**
+     * This is a callback function which is called when a property value of
+     * type int is changed.
+     *
+     * @param aCategory UID of Publish And Subscribe category
+     * @param aKey subkey to specify the category event; to be used with
+     * Publish And Subscribe
+     *
+     * @param aValue the new value
+     */
+    virtual void HandlePropertyChangeL(
+        const TUid& aCategory,
+        const TUint aKey,
+        const TInt aValue ) = 0;
+
+    /**
+     * This is a callback function which is called when a property value of
+     * type byte array is changed.
+     *
+     * @param aCategory UID of Publish And Subscribe category
+     * @param aKey subkey to specify the category event; to be used with
+     * Publish And Subscribe
+     * @param aValue the new value
+     **/
+    virtual void HandlePropertyChangeL(
+        const TUid& aCategory,
+        const TUint aKey,
+        const TDesC8& aValue ) = 0;
+
+    /**
+     * This is a callback function which is called when a property value of
+     * type text is changed.
+     *
+     * @param aCategory UID of Publish And Subscribe category
+     * @param aKey subkey to specify the category event; to be used with
+     * Publish And Subscribe
+     * @param aValue the new value
+     **/
+    virtual void HandlePropertyChangeL(
+        const TUid& aCategory,
+        const TUint aKey,
+        const TDesC& aValue ) = 0;
+
+    /**
+     * This is a callback function which is called when a P&S components
+     * returns an error
+     *
+     * @param aCategory UID of Publish And Subscribe category
+     * @param aKey subkey to specify the category event
+     * @param aError an error code
+     */
+    virtual void HandlePropertyChangeErrorL(
+        const TUid& aCategory,
+        const TUint aKey,
+        TInt aError ) = 0;
+
+};
+
+
+/**
+ * Observer class that observes changes of Property values and propogates
+ * them further.
+ * The class defines a handle to a property, a single data value representing
+ * an item of state information.
+ *
+ */
+NONSHARABLE_CLASS( CRadioPropertyObserver ) : public CActive
+    {
+
+ public:
+
+    /**
+     * Property type. Cannot use RProperty::TType because EByteArray == EText.
+     */
+    enum TRadioPropertyType
+        {
+        ERadioPropertyInt, // Integral property type.
+        ERadioPropertyByteArray, // Byte-array ( 8 bit ), max size 512 bytes
+        ERadioPropertyText // Text ( 16 bit ), max size 512 bytes
+        };
+
+    /**
+     * Two-phased constructor.
+     *
+     * @param aObserver a reference to the observer interface implementer
+     * @param aCategory UID of Publish And Subscribe category
+     * @param aKey subkey to specify the category event; to be used with
+     * Publish And Subscribe
+     * @param aPropertyType property type to observe
+     */
+    IMPORT_C static CRadioPropertyObserver* NewL(
+        MRadioPropertyChangeObserver& aObserver,
+        const TUid& aCategory,
+        const TUint aKey,
+        const TRadioPropertyType aPropertyType );
+
+    ~CRadioPropertyObserver();
+
+    /**
+     * Subscribes the object to listen to the specified key. Does nothing if already active.
+     * Must be called after construction, or after calling Cancel().
+     */
+    IMPORT_C void ActivateL();
+
+    /**
+     * Returns current integer property value
+     *
+     * @return int value
+     */
+    IMPORT_C TInt ValueInt() const;
+
+    /**
+     * Returns current byte array property value
+     *
+     * @return byte array value
+     */
+    IMPORT_C const TDesC8& ValueDes8() const;
+
+    /**
+     * Returns current text property value
+     *
+     * @return text value
+     */
+    IMPORT_C const TDesC& ValueDes() const;
+
+private:
+
+    /**
+     * C++ default constructor overload.
+     * Two-phased constructor.
+     *
+     * @param aObserver a reference to the observer interface implementer
+     * @param aCategory UID of Publish And Subscribe category
+     * @param aKey subkey to specify the category event; to be used with
+     * Publish And Subscribe
+     * @param aPropertyType property type to observe
+     */
+    CRadioPropertyObserver(
+        MRadioPropertyChangeObserver& aObserver,
+        const TUid& aCategory,
+        const TUint aKey,
+        const TRadioPropertyType aPropertyType );
+
+    /**
+     * By default Symbian 2nd phase constructor is private.
+     **/
+    void ConstructL();
+
+protected:
+
+    // from base class Cactive
+    /**
+     * From CActive
+     *
+     * @see CActive::RunL()
+     */
+    void RunL();
+
+    /**
+     * From CActive,
+     *
+     * @see CActive::DoCancel()
+     */
+    void DoCancel();
+
+private: // data
+
+    /**
+     * Value of a subscribed category property of type int.
+     */
+    TInt iValueInt;
+
+    /**
+     * Value of a subscribed category property of type byte array.
+     */
+    HBufC8* iValueByteArray;
+
+    /**
+     * Value of a subscribed category property of type text.
+     */
+    HBufC* iValueText;
+
+    /**
+     * Handle to Publish And Subscribe component
+     */
+    RProperty iProperty;
+
+    /**
+     * Observer to be notified when particular Property value has changed
+     */
+    MRadioPropertyChangeObserver& iObserver;
+
+    /**
+     * UID of Publish And Subscribe category
+     */
+    TUid iCategory;
+
+    /**
+     * Subkey to be used with Publish And Subscribe
+     */
+    TUint iKey;
+
+    /**
+     * Type of the observed property.
+     */
+    TRadioPropertyType iPropertyType;
+
+    };
+
+#endif  // CRADIOPROPERTYOBSERVER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/inc/cradiopubsubimp.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,135 @@
+/*
+* 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 CRADIOPUBSUBIMP_H
+#define CRADIOPUBSUBIMP_H
+
+// User includes
+#include "cradiopubsub.h"
+#include "cradiopropertyobserver.h"
+
+/**
+ *  Publish & Subscribe interface of Radio Application.
+ */
+NONSHARABLE_CLASS( CRadioPubSubImp ) : public CRadioPubSub
+                                     , public MRadioPropertyChangeObserver
+    {
+public:
+
+    static CRadioPubSubImp* NewL();
+
+    ~CRadioPubSubImp();
+
+private:
+
+    CRadioPubSubImp();
+
+    void ConstructL();
+
+// from base class CRadioPubSub
+
+    TBool PublishChannel( TInt aChannelId ) const;
+    TBool PublishFrequency( TUint32 aFreq ) const;
+    TBool PublishPowerState( TBool aPowerOn ) const;
+    TBool PublishVolume( TInt aVol ) const;
+    TBool PublishChannelDataChanged( TInt aChannelId ) const;
+    TBool PublishTuningState( TRadioPSTuningState aTuningState ) const;
+    TBool PublishRadioMuteState( TBool aMuted ) const;
+    TBool PublishApplicationRunningState( TRadioPSApplicationRunningState aRunningState ) const;
+    TBool PublishHeadsetStatus( TRadioPSHeadsetStatus aHeadsetStatus ) const;
+    TBool PublishFrequencyDecimalCount( TRadioPSFrequencyDecimalCount aDecimalCount ) const;
+    TBool PublishLoudspeakerStatus( TRadioPSLoudspeakerStatus aLoudspeakerStatus ) const;
+    TBool PublishRdsProgramService( const TDesC& aProgramService ) const;
+    TBool PublishRdsRadioText( const TDesC& aRadioText ) const;
+    TBool PublishChannelName( const TDesC& aName ) const;
+    TBool PublishActivePreseListCount( TInt aCount ) const;
+    TBool PublishActivePreseListFocus( TInt aIndex ) const;
+    TBool PublishAntennaState( TRadioPSRadioAntennaState aState ) const;
+    void SetControlEventObserver( MRadioControlEventObserver* aControlEventObserver );
+
+// from base class MVRPropertyChangeObserver
+
+    void HandlePropertyChangeL( const TUid& aCategory, const TUint aKey, const TInt aValue );
+    void HandlePropertyChangeL( const TUid& /*aCategory*/, const TUint /*aKey*/, const TDesC8& /*aValue*/ ) {}
+    void HandlePropertyChangeL( const TUid& /*aCategory*/, const TUint /*aKey*/, const TDesC& /*aValue*/ ) {}
+    void HandlePropertyChangeErrorL( const TUid& /*aCategory*/, const TUint /*aKey*/, TInt /*aError*/ ) {}
+
+// New functions
+
+    /**
+     * Defines a property.
+     *
+     * @param aKey The key of the property.
+     * @param aAttr Attributes of the property.
+     * @param aDataProperty ETrue if the property is a data property, EFalse
+     * if it is a control property
+     */
+    void DefinePropertyL( TUint aKey, TInt aAttr, TBool aDataProperty ) const;
+
+    /**
+     * Deletes a property.
+     *
+     * @param aKey The key of the property.
+     */
+    void DeleteProperty( TUint aKey ) const;
+
+    /**
+     * Creates a property observer
+     *
+     * @param aKey Property key
+     * @param aPropertyType Property type
+     */
+    void CreatePropertyObserverL( const TUint aKey, const TInt aPropertyType );
+
+    /**
+     * Gets the integer value stored in a property.
+     *
+     * @param    aKey    The key of the property.
+     * @return   The value contained in the property.
+     */
+    TBool Get( TUint aKey, TInt& aValue ) const;
+
+    /**
+     * Sets the value in an integer property.
+     *
+     * @param    aKey    The key of the property.
+     * @param    aValue  The value to set.
+     */
+    TBool Set( TUint aKey, TInt aValue ) const;
+
+    /**
+     * Sets the value in a text property.
+     *
+     * @param    aKey    The key of the property.
+     * @param    aValue  The value to set.
+     */
+    TBool Set( TUint aKey, const TDesC& aValue ) const;
+
+private: // data
+
+    /**
+     * Pointer to observer in UI side, can be NULL. Not owned.
+     */
+    MRadioControlEventObserver*           iObserver;
+
+    /**
+     * An array of handlers to P&S interface.
+     */
+    RPointerArray<CRadioPropertyObserver> iPropertyArray;
+
+    };
+
+#endif // CRADIOPUBSUBIMP_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/inc/cradioremcontargetimp.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,109 @@
+/*
+* 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 CRADIOREMCONTARGETIMP_H
+#define CRADIOREMCONTARGETIMP_H
+
+// System includes
+#include <RemConCallHandlingTargetObserver.h>
+#include <remconcoreapitargetobserver.h>
+
+// User includes
+#include "cradioremcontarget.h"
+
+// Forward declarations
+class CRemConCallHandlingTarget;
+class CRemConCoreApiTarget;
+class CRemConInterfaceSelector;
+
+// Class declaration
+
+/**
+ * Media key listener
+ */
+NONSHARABLE_CLASS( CRadioRemConTargetImp ) : public CRadioRemConTarget
+                                           , public MRemConCoreApiTargetObserver
+                                           , public MRemConCallHandlingTargetObserver
+    {
+public:
+
+    static CRadioRemConTargetImp* NewL();
+
+    virtual ~CRadioRemConTargetImp();
+
+private:
+
+// from base class CRadioRemConTarget
+
+    void SetControlEventObserver( MRadioControlEventObserver* aControlEventObserver );
+
+// from base class MRemConCoreApiTargetObserver
+
+    void MrccatoCommand( TRemConCoreApiOperationId aOperationId, TRemConCoreApiButtonAction aButtonAct );
+    void MrccatoPlay( TRemConCoreApiPlaybackSpeed aSpeed, TRemConCoreApiButtonAction aButtonAct );
+    void MrccatoTuneFunction( TBool aTwoPart, TUint aMajorChannel, TUint aMinorChannel, TRemConCoreApiButtonAction aButtonAct );
+    void MrccatoSelectDiskFunction( TUint aDisk, TRemConCoreApiButtonAction aButtonAct );
+    void MrccatoSelectAvInputFunction( TUint8 aAvInputSignalNumber, TRemConCoreApiButtonAction aButtonAct );
+    void MrccatoSelectAudioInputFunction( TUint8 aAudioInputSignalNumber, TRemConCoreApiButtonAction aButtonAct );
+
+// from base class MRemConCallHandlingTargetObserver
+
+    void AnswerCall();
+    void AnswerEndCall();
+    void DialCall( const TDesC8& aTelNumber );
+    void EndCall();
+    void GenerateDTMF( const TChar aChar );
+    void LastNumberRedial();
+    void MultipartyCalling( const TDesC8& aData );
+    void SpeedDial( const TInt aIndex );
+    void VoiceDial( const TBool aActivate );
+
+private:
+
+    CRadioRemConTargetImp();
+
+    void ConstructL();
+
+    /**
+     * Callback for repeat timer.
+     * @param aPtr Pointer to this class.
+     */
+    static TInt RepeatTimerCallback( TAny* aPtr );
+
+private: // data
+
+    /** Pointer to observer in UI side, can be NULL. Not owned. */
+    MRadioControlEventObserver* iObserver;
+
+    /** RemCon interface selector. */
+    CRemConInterfaceSelector*   iInterfaceSelector;
+
+    /** RemCon Core API target class. */
+    CRemConCoreApiTarget*       iCoreTarget;
+
+    /** RemCon Call API target class. */
+    CRemConCallHandlingTarget*  iCallTarget;
+
+    /** Timer for generating repeat events. */
+    CPeriodic*                  iRepeatTimer;
+
+    /** Operation id to repeat. */
+    TRemConCoreApiOperationId   iRepeatId;
+
+    };
+
+#endif // CRADIOREMCONTARGETIMP_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/inc/cradiorepositoryentity.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,90 @@
+/*
+* 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 C_RADIOREPOSITORYENTITY_H
+#define C_RADIOREPOSITORYENTITY_H
+
+#include <centralrepository.h>
+#include "cradiorepositoryentitybase.h"
+#include "mradiorepositoryentityobserver.h"
+
+/**
+ * Templated class to listen to a single key within the central repository.
+ *
+ * Notifies the observer of changes in the key, and provides caching for the key's value.
+ */
+template <typename T>
+NONSHARABLE_CLASS( CRadioRepositoryEntity ) : public CRadioRepositoryEntityBase
+    {
+
+public:
+
+    static CRadioRepositoryEntity<T>* NewL( const TUid& aUid, 
+                                            TUint32 aKey, 
+                                            MRadioRepositoryEntityObserver& aObserver, 
+                                            CActive::TPriority aPriority = CActive::EPriorityStandard );
+
+    ~CRadioRepositoryEntity();
+
+    /**
+     * Sets the value of the entity.
+     * The value is written into the central repository immediately.
+     *
+     * @param   aValue  The value to set.
+     * @param   aSavingEnabled If ETrue, saving to central repository file is enabled
+     */
+    TInt SetValue( const T& aValue, TBool aSavingEnabled );
+
+    /**
+     * Returns a cached reference to the value of the entity.
+     *
+     * @return  The cached value of the entity.
+     */
+    const T& Value() const;
+
+    /**
+     * Forcibly updates the key's value from the central repository and caches it.
+     */
+    void UpdateL();
+
+// from base class CActive
+
+    void RunL();
+    void DoCancel();
+
+private:
+
+    CRadioRepositoryEntity( const TUid& aUid, 
+                            TUint32 aKey, 
+                            MRadioRepositoryEntityObserver& aObserver, 
+                            CActive::TPriority aPriority );
+
+    void ConstructL();
+
+protected:
+
+    /** The central repository client. */
+    CRepository*    iRepository;
+    
+    /** The cached value of the key. */
+    T               iValue;
+
+    };
+
+#include "cradiorepositoryentity.inl"
+
+#endif // C_RADIOREPOSITORYENTITY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/inc/cradiorepositoryentity.inl	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,129 @@
+/*
+* 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:
+*
+*/
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+template <typename T>
+CRadioRepositoryEntity<T>* CRadioRepositoryEntity<T>::NewL( const TUid& aUid,
+                                                            TUint32 aKey,
+                                                            MRadioRepositoryEntityObserver& aObserver,
+                                                            CActive::TPriority aPriority )
+    {
+    CRadioRepositoryEntity<T>* self = new ( ELeave ) CRadioRepositoryEntity<T>( aUid, aKey, aObserver, aPriority );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+template <typename T>
+CRadioRepositoryEntity<T>::CRadioRepositoryEntity( const TUid& aUid,
+                                                   TUint32 aKey,
+                                                   MRadioRepositoryEntityObserver& aObserver,
+                                                   CActive::TPriority aPriority )
+    : CRadioRepositoryEntityBase( aUid, aKey, aObserver, aPriority )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+template <typename T>
+void CRadioRepositoryEntity<T>::ConstructL()
+    {
+    iRepository = CRepository::NewL( iUid );
+
+    CActiveScheduler::Add( this );
+    RunL();
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+template <typename T>
+CRadioRepositoryEntity<T>::~CRadioRepositoryEntity()
+    {
+    Cancel();
+    delete iRepository;
+    }
+
+// -----------------------------------------------------------------------------
+// Sets the value of the key.
+// -----------------------------------------------------------------------------
+//
+template <typename T>
+TInt CRadioRepositoryEntity<T>::SetValue( const T& aValue, TBool aSavingEnabled )
+    {
+    iValue = aValue;
+    if ( aSavingEnabled )
+        {
+        return iRepository->Set( iKey, aValue );
+        }
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// Returns the cached copy of the key's value.
+// -----------------------------------------------------------------------------
+//
+template <typename T>
+const T& CRadioRepositoryEntity<T>::Value() const
+    {
+    return iValue;
+    }
+
+// -----------------------------------------------------------------------------
+// Forcibly updates the cached value from the repository.
+// -----------------------------------------------------------------------------
+//
+template <typename T>
+void CRadioRepositoryEntity<T>::UpdateL()
+    {
+    User::LeaveIfError( iRepository->Get( iKey, iValue ) );
+    }
+
+// -----------------------------------------------------------------------------
+// Executed when the key's value is changed.
+// -----------------------------------------------------------------------------
+//
+template <typename T>
+void CRadioRepositoryEntity<T>::RunL()
+    {
+    User::LeaveIfError( iRepository->NotifyRequest( iKey, iStatus ) );
+    SetActive();
+
+    TInt err = iRepository->Get( iKey, iValue );
+    iObserver.HandleRepositoryValueChangeL( iUid, iKey, iValue, err );
+    }
+
+// -----------------------------------------------------------------------------
+// Cancels all pending notifications.
+// -----------------------------------------------------------------------------
+//
+template <typename T>
+void CRadioRepositoryEntity<T>::DoCancel()
+    {
+    iRepository->NotifyCancel( iKey );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/inc/cradiorepositoryentitybase.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,78 @@
+/*
+* 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 C_RADIOREPOSITORYENTITYBASE_H
+#define C_RADIOREPOSITORYENTITYBASE_H
+
+#include <e32base.h>
+
+class MRadioRepositoryEntityObserver;
+
+/**
+ * Base class for a central repository entity.
+ *
+ * All instantiable central repository entities must be derived from this class.
+ * The class is provided so that a heterogenous array of templated objects can be created, and to
+ * provide common data fields for the said purpose.
+ */
+NONSHARABLE_CLASS( CRadioRepositoryEntityBase ) : public CActive
+    {
+
+public:
+
+    ~CRadioRepositoryEntityBase();
+
+    /**
+     * Returns the UID of the repository the entity is bound to.
+     *
+     * @return  The UID of the repository the entity is bound to.
+     */
+    const TUid& Uid() const;
+
+    /**
+     * Returns the key the entity is bound to.
+     *
+     * @return  The key the entity is bound to.
+     */
+    TUint32 Key() const;
+
+protected:
+
+    /**
+     * Constructor.
+     *
+     * @param   aUid        The UID of the repository that this entity will be bound to.
+     * @param   aKey        The key within the repository that this entity will be bound to.
+     * @param   aObserver   The observer that is notified whenever the value of the key within the repository changes.
+     * @param   aPriority   The priority of the active object.
+     */
+    CRadioRepositoryEntityBase( const TUid& aUid, TUint32 aKey, MRadioRepositoryEntityObserver& aObserver, CActive::TPriority aPriority );
+
+protected:
+
+    /** The observer that is notified of changes in the key. */
+    MRadioRepositoryEntityObserver& iObserver;
+
+    /** The UID of the repository the entity is bound to. */
+    TUid iUid;
+
+    /** The key the entity is bound to.. */
+    TUint32 iKey;
+
+    };
+
+#endif // C_RADIOREPOSITORYENTITYBASE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/inc/cradiorepositorymanagerimp.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,218 @@
+/*
+* 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 C_RADIOREPOSITORYMANAGERIMP_H
+#define C_RADIOREPOSITORYMANAGERIMP_H
+
+// System includes
+#include <centralrepository.h>
+
+// User includes
+#include "mradiorepositoryentityobserver.h"
+
+// Forward declarations
+class CRadioRepositoryEntityBase;
+
+/**
+ *  Central repository entity manager.
+ *
+ *  Manages central repository entities that listen to specific repository and a key within it, notifying the observer
+ *  whenever the key's value changes.
+ *
+ *  Also a set of static methods are provided that wrap the common use case of central repository where the user
+ *  is only interested to read or write the value of a key and then discard the repository object.
+ */
+NONSHARABLE_CLASS( CRadioRepositoryManagerImp ) : public CRadioRepositoryManager
+                                                , public MRadioRepositoryEntityObserver
+    {
+
+public:
+
+    static CRadioRepositoryManagerImp* NewL( TInt aGranularity );
+
+    ~CRadioRepositoryManagerImp();
+
+    /**
+     * Sets the value of an integer key in the repository.
+     *
+     * @param   aUid        The UID of the repository.
+     * @param   aKey        The key within the repository.
+     * @param   aValue      The value to set.
+     */
+    static void SetRepositoryValueL( const TUid& aUid, TUint32 aKey, TInt aValue );
+
+    /**
+     * Sets the value of a floating point key in the repository.
+     *
+     * @param   aUid        The UID of the repository.
+     * @param   aKey        The key within the repository.
+     * @param   aValue      The value to set.
+     */
+    static void SetRepositoryValueL( const TUid& aUid, TUint32 aKey, const TReal& aValue );
+
+    /**
+     * Sets the value of a binary key in the repository.
+     *
+     * @param   aUid        The UID of the repository.
+     * @param   aKey        The key within the repository.
+     * @param   aValue      The value to set.
+     */
+    static void SetRepositoryValueL( const TUid& aUid, TUint32 aKey, const TDesC8& aValue );
+
+    /**
+     * Sets the value of a string key in the repository.
+     *
+     * @param   aUid        The UID of the repository.
+     * @param   aKey        The key within the repository.
+     * @param   aValue      The value to set.
+     */
+    static void SetRepositoryValueL( const TUid& aUid, TUint32 aKey, const TDesC16& aValue );
+
+    /**
+     * Gets the value of an integer key in the repository.
+     *
+     * @param   aUid        The UID of the repository.
+     * @param   aKey        The key within the repository.
+     * @param   aValue      On return, the value of the key within the repository.
+     */
+    static void GetRepositoryValueL( const TUid& aUid, TUint32 aKey, TInt& aValue );
+
+    /**
+     * Gets the value of a floating point key in the repository.
+     *
+     * @param   aUid        The UID of the repository.
+     * @param   aKey        The key within the repository.
+     * @param   aValue      On return, the value of the key within the repository.
+     */
+    static void GetRepositoryValueL( const TUid& aUid, TUint32 aKey, TReal& aValue );
+
+    /**
+     * Gets the value of a binary key in the repository.
+     *
+     * @param   aUid        The UID of the repository.
+     * @param   aKey        The key within the repository.
+     * @param   aValue      On return, the value of the key within the repository.
+     */
+    static void GetRepositoryValueL( const TUid& aUid, TUint32 aKey, TDes8& aValue );
+
+    /**
+     * Gets the value of a string key in the repository.
+     *
+     * @param   aUid        The UID of the repository.
+     * @param   aKey        The key within the repository.
+     * @param   aValue      On return, the value of the key within the repository.
+     */
+    static void GetRepositoryValueL( const TUid& aUid, TUint32 aKey, TDes16& aValue );
+
+private:
+
+    CRadioRepositoryManagerImp( TInt aGranularity );
+
+    void ConstructL();
+
+// from base class CRadioRepositoryManager
+
+    void AddObserverL( MRadioRepositoryEntityObserver* aObserver );
+    void RemoveObserver( MRadioRepositoryEntityObserver* aObserver );
+    void EnableSave( TBool aEnable );
+    void AddEntityL( const TUid& aUid, TUint32 aKey, TRadioEntityType aType );
+    void RemoveEntity( const TUid& aUid, TUint32 aKey );
+    TInt SetEntityValue( const TUid& aUid, TUint32 aKey, TInt aValue );
+    TInt SetEntityValue( const TUid& aUid, TUint32 aKey, const TReal& aValue );
+    TInt SetEntityValue( const TUid& aUid, TUint32 aKey, const TDesC8& aValue );
+    TInt SetEntityValue( const TUid& aUid, TUint32 aKey, const TDesC16& aValue );
+    TInt EntityValueInt( const TUid& aUid, TUint32 aKey ) const;
+    const TReal& EntityValueReal( const TUid& aUid, TUint32 aKey ) const;
+    const TDesC8& EntityValueDes8( const TUid& aUid, TUint32 aKey ) const;
+    const TDesC16& EntityValueDes16( const TUid& aUid, TUint32 aKey ) const;
+
+    /**
+     * Sets the value of an entity.
+     *
+     * @param   aUid        The UID of the entity.
+     * @param   aKey        The key of the entity.
+     * @param   aValue      The value to set.
+     */
+    template <typename T>
+    TInt DoSetEntityValue( const TUid& aUid, TUint32 aKey, const T& aValue );
+
+    /**
+     * Returns an entity's cached value.
+     *
+     * @param   aUid        The UID of the entity.
+     * @param   aKey        The key of the entity.
+     * @return  The cached value of the entity.
+     */
+    template <typename T>
+    const T& DoEntityValue( const TUid& aUid, TUint32 aKey ) const;
+
+    /**
+     * Sets the value of a key.
+     *
+     * @param   aUid        The UID of the repository.
+     * @param   aKey        The key within the repository.
+     * @param   aValue      The value to set.
+     */
+    template <typename T>
+    static void DoSetRepositoryValueL( const TUid& aUid, TUint32 aKey, const T& aValue );
+
+    /**
+     * Returns a key's value.
+     *
+     * @param   aUid        The UID of the repository.
+     * @param   aKey        The key within the repository.
+     * @return  The key's value.
+     */
+    template <typename T>
+    static void DoGetRepositoryValueL( const TUid& aUid, TUint32 aKey, T& aValue );
+
+    /**
+     * Returns the entity's index by its UID and key.
+     *
+     * @param   aUid        The UID of the entity.
+     * @param   aKey        The key of the entity.
+     * @param   The entity's index or <code>KErrNotFound</code> if no such entity could be found.
+     */
+    TInt EntityIndex( const TUid& aUid, TUint32 aKey ) const;
+
+    /**
+     * SIS installation does not update central repository, this checks that the new keys are in the repository.
+     */
+    void CheckRepositoryKeysL();
+
+// from base class MRadioRepositoryEntityObserver
+
+    void HandleRepositoryValueChangeL( const TUid& aUid, TUint32 aKey, TInt aValue, TInt aError );
+    void HandleRepositoryValueChangeL( const TUid& aUid, TUint32 aKey, const TReal& aValue, TInt aError );
+    void HandleRepositoryValueChangeL( const TUid& aUid, TUint32 aKey, const TDesC8& aValue, TInt aError );
+    void HandleRepositoryValueChangeL( const TUid& aUid, TUint32 aKey, const TDesC16& aValue, TInt aError );
+
+private: // data
+
+    /** The observers that are notified of changes in the entities' values. */
+    RPointerArray<MRadioRepositoryEntityObserver> iObservers;
+
+    /** The entities registered. */
+    RPointerArray<CRadioRepositoryEntityBase> iEntities;
+
+    /** Indicates whether or not the entities are allowed to write to the repository. */
+    TBool iEnableSave;
+
+    };
+
+#endif // C_RADIOREPOSITORYMANAGERIMP_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/inc/cradiosystemeventcollectorimp.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,102 @@
+/*
+* 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 CRADIOSYSTEMEVENTCOLLECTORIMP_H
+#define CRADIOSYSTEMEVENTCOLLECTORIMP_H
+
+#include "cradiosystemeventcollector.h"
+#include "mradioaudioroutingobserver.h"
+#include "mradioheadseteventobserver.h"
+#include "mradiosystemeventdetectorobserver.h"
+#include "mradiosystemeventobserver.h"
+
+class CRadioAccessoryObserver;
+class CRadioSystemEventDetector;
+
+/**
+ *  Collects system events and forwards them to observers
+ *  Class also wraps up the getters for some system states
+ */
+NONSHARABLE_CLASS( CRadioSystemEventCollectorImp ) : public CRadioSystemEventCollector
+                                                   , public MRadioAudioRoutingObserver
+                                                   , public MRadioHeadsetEventObserver
+                                                   , public MRadioSystemEventDetectorObserver
+    {
+public:
+
+    static CRadioSystemEventCollectorImp* NewL();
+
+    ~CRadioSystemEventCollectorImp();
+
+private:
+
+    CRadioSystemEventCollectorImp();
+
+    void ConstructL();
+
+// from base class CRadioSystemEventCollector
+
+    void AddObserverL( MRadioSystemEventObserver* aSystemObserver );
+    void RemoveObserver( MRadioSystemEventObserver* aSystemObserver );
+    TBool IsNetworkCoverage() const;
+    TBool IsMobileNetworkCoverage() const;
+    TBool IsCallActive() const;
+    TBool IsAudioResourcesAvailable() const;
+    TBool IsHeadsetConnectedL() const;
+    TBool IsVoiceUiActive() const;
+
+    void NotifyObserversL( TRadioSystemEventType aEvent );
+
+// from base class MRadioSystemEventDetectorObserver
+
+    void NetworkUpCallbackL();
+    void NetworkDownCallbackL();
+    void CallActivatedCallbackL();
+    void CallDeactivatedCallbackL();
+    void AudioResourcesAvailableL();
+    void AudioAutoResumeForbiddenL();
+    void ErrorCallbackL( TInt aError );
+
+// from base class MRadioHeadsetEventObserver
+
+    void HeadsetConnectedCallbackL();
+    void HeadsetDisconnectedCallbackL();
+
+// from base class MRadioAudioRoutingObserver
+
+    void AudioRouteChangedL( RadioEngine::TRadioAudioRoute aRoute );
+
+private: // data
+
+    /**
+     * Array of system event observers
+     */
+    RPointerArray<MRadioSystemEventObserver> iSystemEventObservers;
+
+    /**
+     * Detects system events
+     */
+    CRadioSystemEventDetector* iSystemEventDetector;
+
+    /**
+     * Observer for accessory events
+     */
+    CRadioAccessoryObserver* iHeadsetObserver;
+
+    };
+
+#endif // CRADIOSYSTEMEVENTCOLLECTORIMP_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/inc/cradiosystemeventdetector.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,124 @@
+/*
+* 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 CRADIOSYSTEMEVENTDETECTOR_H
+#define CRADIOSYSTEMEVENTDETECTOR_H
+
+#include <e32base.h>
+
+#include "cradiopropertyobserver.h"
+
+class MRadioSystemEventDetectorObserver;
+
+/**
+* Catches notification of the call and network state changes.
+*
+* Class provides implementation to detect system events and notify UI components of the event,
+* Class keeps several instances of CVPropertyObserver, and those instances send event notifications
+* about the particular system component state change.
+*/
+NONSHARABLE_CLASS( CRadioSystemEventDetector ) : public CBase
+                                               , public MRadioPropertyChangeObserver
+    {
+public:
+
+    static CRadioSystemEventDetector* NewL( MRadioSystemEventDetectorObserver&  aObserver );
+
+    virtual ~CRadioSystemEventDetector();
+
+    /**
+     * Returns network coverage state ( wlan or mobile ).
+     */
+    TBool IsNetworkCoverage() const;
+
+    /**
+     * Returns mobile network coverage state.
+     */
+    TBool IsMobileNetworkCoverage() const;
+
+    /**
+     * Returns current call state.
+     */
+    TBool IsCallActive() const;
+
+    /**
+     * Returns current audio resources state.
+     * @return audio resources state
+     */
+    TBool IsAudioResourcesAvailable() const;
+
+    /**
+     * Returns current Voice UI state.
+     * @return ETrue if Voice UI is active, EFalse otherwise
+     */
+    TBool IsVoiceUiActive() const;
+
+protected:
+
+// from base class MRadioPropertyChangeObserver
+
+    void HandlePropertyChangeL( const TUid& aCategory, const TUint aKey, const TInt aValue );
+    void HandlePropertyChangeL( const TUid& aCategory, const TUint aKey, const TDesC8& aValue );
+    void HandlePropertyChangeL( const TUid& aCategory, const TUint aKey, const TDesC& aValue );
+    void HandlePropertyChangeErrorL( const TUid& aCategory, const TUint aKey, TInt aError );
+
+private:
+
+    void ConstructL();
+
+    /**
+     * Used internally to change network coverage status and report it to observer.
+     */
+    void SetNetworkCoverageL( const TBool aIsMobileNetworkCoverage, const TBool aIsWlanCoverage );
+
+    CRadioSystemEventDetector( MRadioSystemEventDetectorObserver&  aObserver );
+
+private: // data
+
+    /** Observer which will be notified of the call and network state changes*/
+    MRadioSystemEventDetectorObserver&  iObserver;
+
+    /** handler to Publish & Subscribe interface*/
+    CRadioPropertyObserver*    iCallStatusObserver;
+    /** handler to Publish & Subscribe interface*/
+    CRadioPropertyObserver*    iNetworkStatusObserver;
+    /** handler to Publish & Subscribe interface*/
+    CRadioPropertyObserver*    iVoiceUiObserver;
+    /** handler to Publish & Subscribe interface*/
+    CRadioPropertyObserver*    iAudioPolicyObserver;
+
+    /**Indicator for the mobile network status*/
+    TBool iIsMobileNetworkCoverage;
+
+    /**Indicator for the wlan network status*/
+    TBool iIsWlanCoverage;
+
+    /**Indicator for the call status*/
+    TBool iIsCallActive;
+
+    /** Array of audio policy categories that VR must not resume after. */
+    RArray<TInt> iNoAutoResumeAudioCategories;
+
+    /** Indicator for audio resource status. */
+    TBool iIsAudioResourcesAvailable;
+
+    /** Indicator for Voice UI status. */
+    TBool iIsVoiceUiActive;
+    
+    };
+
+#endif // CRADIOSYSTEMEVENTDETECTOR_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/inc/mradioheadseteventobserver.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MRADIOHEADSETEVENTOBSERVER_H
+#define MRADIOHEADSETEVENTOBSERVER_H
+
+
+// Class declaration
+/**
+*
+*  Observer for the Headset button state. Implementer will be notified each time the headset button
+*  state has changed ( button pressed ).
+*/
+NONSHARABLE_CLASS( MRadioHeadsetEventObserver )
+    {
+public:
+
+    /**
+    * This callback will notify of the Headset to be connected
+    */
+    virtual void HeadsetConnectedCallbackL() = 0;
+
+    /**
+    * This callback will notify of the Headset to be disconnected
+    */
+    virtual void HeadsetDisconnectedCallbackL() = 0;
+
+    };
+
+#endif // MRADIOHEADSETEVENTOBSERVER_H
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/inc/mradiosystemeventdetectorobserver.h	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,70 @@
+/*
+* 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 MRADIOSYSTEMEVENTDETECTOROBSERVER_H
+#define MRADIOSYSTEMEVENTDETECTOROBSERVER_H
+
+// Class declaration
+/**
+*
+*  Observer for the call and network state. Implementer will be notified each time the state has changed
+*/
+NONSHARABLE_CLASS( MRadioSystemEventDetectorObserver )
+    {
+public:
+
+    /**
+    * This callback notifies when networks comes up.
+    */
+    virtual void NetworkUpCallbackL() = 0;
+
+    /**
+    * This callback notifies when network goes down.
+    */
+    virtual void NetworkDownCallbackL() = 0;
+
+    /**
+    * This callback notifies when call becomes active.
+    */
+    virtual void CallActivatedCallbackL() = 0;
+
+    /**
+    * This callback notifies when call becomes deactive.
+    */
+    virtual void CallDeactivatedCallbackL() = 0;
+
+    /**
+    * This callback notifies when audio resources become available.
+    */
+    virtual void AudioResourcesAvailableL() = 0;
+
+    /**
+    * This callback notifies when audio auto resuming is forbidden.
+    */
+    virtual void AudioAutoResumeForbiddenL() = 0;
+
+    /**
+    * This callback notifies when an error occured
+    * @param aError an error code
+    */
+    virtual void ErrorCallbackL( TInt aError ) = 0;
+
+    };
+
+#endif // MRADIOSYSTEMEVENTDETECTOROBSERVER_H
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/src/cradioaccessoryobserver.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,357 @@
+/*
+* 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:
+*
+*/
+
+// User includes
+#include "cradioaccessoryobserver.h"
+#include "mradioheadseteventobserver.h"
+#include "cradioenginelogger.h"
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioAccessoryObserver::CRadioAccessoryObserver()
+    : CActive( CActive::EPriorityStandard )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioAccessoryObserver::ConstructL()
+    {
+    LOG_METHOD_AUTO;
+    User::LeaveIfError( iAccessoryServer.Connect() );
+
+    // Creates a new sub-session within an existing session.
+    User::LeaveIfError( iAccessoryConn.CreateSubSession( iAccessoryServer ) );
+    User::LeaveIfError( iAccessoryConn.GetAccessoryConnectionStatus( iAccPolGenIdArr ) );
+
+    TInt nroChangedAccessories( 0 );
+    UpdateCurrentAccessoriesL( nroChangedAccessories );
+    LOG_FORMAT( "CRadioAccessoryObserver::ConstructL() -- Found %d wired/BT accessories ( %d accessories in total ).",
+              nroChangedAccessories, iAccPolGenIdArr.Count() );
+    CActiveScheduler::Add( this );
+    // Accessory is always listened
+    iAccessoryConn.NotifyAccessoryConnectionStatusChanged( iStatus, iAccPolGenIdArr );
+    SetActive();
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioAccessoryObserver* CRadioAccessoryObserver::NewL()
+    {
+    CRadioAccessoryObserver* self = new( ELeave ) CRadioAccessoryObserver;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioAccessoryObserver::~CRadioAccessoryObserver()
+    {
+    Cancel();
+    iAccessoryConn.CloseSubSession();
+    iAccessoryServer.Close();
+    iSavedAccessories.Close();
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioAccessoryObserver::FindAccessoryL( TBool aAcceptOnlyHeadset, TAccAudioOutPutType& aOutputType ) const
+    {
+#ifdef __WINS__
+    TBool accessoryFound = ETrue;
+    aAcceptOnlyHeadset = ETrue;
+    aOutputType = EAccAudioOutPutTypePrivate;
+#else
+    TBool accessoryFound = EFalse;
+
+    LOG_FORMAT( "CRadioAccessoryObserver::FindAccessoryL - Connected accessories count = %d", iAccPolGenIdArr.Count());
+    for ( TInt i = 0; i < iAccPolGenIdArr.Count() && !accessoryFound; i++ )
+        {
+        TAccPolGenericID accPolGenId = iAccPolGenIdArr.GetGenericIDL( i );
+
+        //Check if physical connection is of acceptable type
+        TUint32 physicalConnectionCaps = accPolGenId.PhysicalConnectionCaps();
+        if ( physicalConnectionCaps & KPCWired || physicalConnectionCaps & KPCBluetooth )
+            {
+            LOG_FORMAT( "CRadioAccessoryObserver::FindAccessoryL - is wired or BT ( physicalConnectionCaps = %d )", physicalConnectionCaps );
+
+            if ( !aAcceptOnlyHeadset )
+                {
+                accessoryFound = ETrue;
+                }
+            //Get device type ( check if is HeadSet )
+            TUint32 deviceType = accPolGenId.DeviceTypeCaps();
+            if ( deviceType & KDTHeadset )
+                {
+                LOG_FORMAT( "CRadioAccessoryObserver::FindAccessoryL - is HeadSet( deviceType = %d )", deviceType );
+                if ( !IsLineoutConnectedL( accPolGenId ) )
+                    {
+                    LOG( "CRadioAccessoryObserver::FindAccessoryL - Is a normal headSet" );
+                    accessoryFound = ETrue;
+                    }
+                }
+            else if ( deviceType & KDTLoopset )
+                {
+                LOG_FORMAT( "CRadioAccessoryObserver::FindAccessoryL - is Loopset( deviceType = %d )", deviceType );
+                accessoryFound = ETrue;
+                }
+            else
+                {
+                LOG_FORMAT( "CRadioAccessoryObserver::FindWiredAccessoryL - is NOT HeadSet or Loopset( deviceType = %d )", deviceType );
+                }
+
+            if ( accessoryFound )
+                {
+                // get the public/private status
+                TAccPolNameRecord nameRecord;
+                nameRecord.SetNameL( KAccAudioOutputType );
+
+                TAccValueTypeTInt audioOutputTypeValue;
+                iAccessoryConn.GetValueL( accPolGenId, nameRecord, audioOutputTypeValue );
+
+                aOutputType = static_cast<TAccAudioOutPutType>( audioOutputTypeValue.iValue );
+                LOG_FORMAT( "CRadioAccessoryObserver::FindAccessoryL - AudioOutputType = %d", aOutputType );
+                }
+            }
+        else
+            {
+            LOG_FORMAT( "CRadioAccessoryObserver::FindAccessoryL - is NOT wired or BT ( physicalConnectionCaps = %d )", physicalConnectionCaps );
+            }
+        }
+#endif
+    return accessoryFound;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioAccessoryObserver::IsHeadsetConnectedL() const
+    {
+    TAccAudioOutPutType audioOutputType( EAccAudioOutPutTypePrivate );
+    return FindAccessoryL( ETrue , audioOutputType );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioAccessoryObserver::IsLineoutConnectedL( TAccPolGenericID& aAccPolGenId ) const
+    {
+    TBool isLineOut( EFalse );
+
+    CAccPolSubblockNameArray* nameArray = CAccPolSubblockNameArray::NewL();
+    CleanupStack::PushL( nameArray );
+    iAccessoryConn.GetSubblockNameArrayL( aAccPolGenId, *nameArray );
+
+    TBool isAudioOutValue = nameArray->HasName( KAccAudioOut );
+    CleanupStack::PopAndDestroy( nameArray );
+    if ( isAudioOutValue )
+        {
+        LOG_FORMAT( "CRadioAccessoryObserver::IsLineoutConnectedL - isAudioOutValue = ( %d )", isAudioOutValue );
+
+        TAccPolNameRecord nameRecord;
+        nameRecord.SetNameL( KAccAudioOut );
+
+        //Check if connected accessory is LineOut
+        TAccValueTypeTInt audioOutValue;
+        iAccessoryConn.GetValueL( aAccPolGenId, nameRecord, audioOutValue );
+
+        LOG( "CRadioAccessoryObserver::IsLineoutConnectedL - GetValueL() - OK" );
+        if ( TAccAudioOutLineout == audioOutValue.iValue )
+            {
+            //is lineout
+            LOG_FORMAT( "CRadioAccessoryObserver::IsLineoutConnectedL - Accessory is LineOut( audioOutValue = %d )", audioOutValue.iValue );
+            isLineOut = ETrue;
+            }
+        }
+    return isLineOut;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioAccessoryObserver::UpdateCurrentAccessoriesL( TInt& aNroChangedAccessories )
+    {
+    // first check, the removed accessories.
+    TInt removedAccessories = CountRemovedAccessoriesL();
+    LOG_FORMAT( "CRadioAccessoryObserver::UpdateCurrentAccessoriesL() -- %d accessories removed.", removedAccessories );
+    aNroChangedAccessories += removedAccessories;
+    TInt addedAccessories = CountAddedAccessoriesL();
+    LOG_FORMAT( "CRadioAccessoryObserver::UpdateCurrentAccessoriesL() -- %d accessories added.", addedAccessories );
+    aNroChangedAccessories += addedAccessories;
+
+    iSavedAccessories.Reset();
+
+    for ( TInt i = 0; i < iAccPolGenIdArr.Count(); i++ )
+        {
+        iSavedAccessories.AppendL( iAccPolGenIdArr.GetGenericIDL( i ) );
+        LOG_FORMAT( "CRadioAccessoryObserver::UpdateCurrentAccessoriesL() -- accessory in slot %d: %d",
+                  i, iAccPolGenIdArr.GetGenericIDL( i ).UniqueID() );
+        }
+    LOG_FORMAT( "CRadioAccessoryObserver::UpdateCurrentAccessoriesL() -- %d accessories in total.", iSavedAccessories.Count() );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TInt CRadioAccessoryObserver::CountRemovedAccessoriesL() const
+    {
+    TInt removedAccessories( 0 );
+
+    for ( TInt i = 0; i < iSavedAccessories.Count(); i++ )
+        {
+        TAccPolGenericID savedAcc = iSavedAccessories[i];
+
+        TUint32 physicalConnectionCaps = savedAcc.PhysicalConnectionCaps();
+
+        if ( physicalConnectionCaps & KPCWired || physicalConnectionCaps & KPCBluetooth )
+            {
+            TBool found( EFalse );
+
+            for ( TInt j = 0; j < iAccPolGenIdArr.Count() && !found; j++ )
+                {
+                TAccPolGenericID freshAcc = iAccPolGenIdArr.GetGenericIDL( j );
+                if ( freshAcc.UniqueID() == savedAcc.UniqueID() )
+                    {
+                    LOG_FORMAT( "CRadioAccessoryObserver::CountRemovedAccessoriesL() -- Accessory with id = %d found.", savedAcc.UniqueID() );
+                    found = ETrue;
+                    }
+                }
+            if ( !found )
+                {
+                LOG_FORMAT( "CRadioAccessoryObserver::CountRemovedAccessoriesL() -- Accessory with id = %d removed.", savedAcc.UniqueID() );
+                removedAccessories++;
+                }
+            }
+        }
+    return removedAccessories;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TInt CRadioAccessoryObserver::CountAddedAccessoriesL() const
+    {
+    TInt addedAccessories( 0 );
+
+    for ( TInt i = 0; i < iAccPolGenIdArr.Count(); i++ )
+        {
+        TAccPolGenericID freshAcc = iAccPolGenIdArr.GetGenericIDL( i );
+
+        TUint32 physicalConnectionCaps = freshAcc.PhysicalConnectionCaps();
+
+        if ( physicalConnectionCaps & KPCWired || physicalConnectionCaps & KPCBluetooth )
+            {
+            TBool found( EFalse );
+
+            for ( TInt j = 0; j < iSavedAccessories.Count() && !found; j++ )
+                {
+                TAccPolGenericID savedAcc = iSavedAccessories[j];
+                if ( savedAcc.UniqueID() == freshAcc.UniqueID() )
+                    {
+                    LOG_FORMAT( "CRadioAccessoryObserver::CountAddedAccessoriesL() -- Accessory with id = %d found.", freshAcc.UniqueID() );
+                    found = ETrue;
+                    }
+                }
+            if ( !found )
+                {
+                LOG_FORMAT( "CRadioAccessoryObserver::CountAddedAccessoriesL() -- Accessory with id = %d added.", freshAcc.UniqueID() );
+                addedAccessories++;
+                }
+            }
+        }
+    return addedAccessories;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioAccessoryObserver::SetObserver( MRadioHeadsetEventObserver* aObserver )
+    {
+    iObserver = aObserver;
+    }
+
+// ---------------------------------------------------------------------------
+// From class CActive
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioAccessoryObserver::RunL()
+    {
+    TRequestStatus status = iStatus;
+    iAccessoryConn.NotifyAccessoryConnectionStatusChanged( iStatus, iAccPolGenIdArr );
+
+    SetActive();
+
+    TInt nroChangedAccessories( 0 );
+    UpdateCurrentAccessoriesL( nroChangedAccessories );
+
+    if ( status == KErrNone && nroChangedAccessories != 0 )
+        {
+        TAccAudioOutPutType audioOutputType( EAccAudioOutPutTypePrivate );
+
+        if ( FindAccessoryL( EFalse, audioOutputType ) )
+            {
+            // Accessory mode may change when combined connection status changes
+            // or when audio routing status changes.
+            if ( audioOutputType == EAccAudioOutPutTypePrivate )
+                {
+                LOG( "CRadioAccessoryObserver::RunL - Headset connected" );
+                iObserver->HeadsetConnectedCallbackL();
+                }
+            else
+                {
+                LOG( "CRadioAccessoryObserver::RunL - Public wired or BT accessory connected." );
+                iObserver->HeadsetDisconnectedCallbackL();
+                }
+            }
+        else
+            {
+            LOG( "CRadioAccessoryObserver::RunL - No wired or BT accessories available" );
+            iObserver->HeadsetDisconnectedCallbackL();
+            }
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class CActive
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioAccessoryObserver::DoCancel()
+    {
+    iAccessoryConn.CancelNotifyAccessoryConnectionStatusChanged();
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/src/cradioaudiorouter.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,112 @@
+/*
+* 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:
+*
+*/
+
+// User includes
+#include "cradioenginelogger.h"
+#include "cradioaudiorouter.h"
+#include "mradioaudioroutingobserver.h"
+#include "cradioroutableaudio.h"
+#include "radioengineutils.h"
+
+
+const TInt KVisualRadioInitialRoutableAudioArraySize( 2 );
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioAudioRouter::CRadioAudioRouter( MRadioAudioRoutingObserver& aAudioRoutingObserver )
+    : iAudioRoutingObserver( aAudioRoutingObserver )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CRadioAudioRouter* CRadioAudioRouter::NewL( MRadioAudioRoutingObserver& aAudioRoutingObserver )
+    {
+    CRadioAudioRouter* self = new( ELeave ) CRadioAudioRouter( aAudioRoutingObserver );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CRadioAudioRouter::~CRadioAudioRouter()
+    {
+    iRoutableAudios.Close();
+    RadioEngineUtils::Release();
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioAudioRouter::ConstructL()
+    {
+    RadioEngineUtils::InitializeL();
+    iRoutableAudios = RArray<CRadioRoutableAudio*>( KVisualRadioInitialRoutableAudioArraySize );
+    }
+
+// ---------------------------------------------------------------------------
+// Sets audio route
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CRadioAudioRouter::SetAudioRouteL( RadioEngine::TRadioAudioRoute aAudioRoute )
+    {
+    LOG_FORMAT( "CRadioAudioRouter::SetAudioRouteL: Route: %d", aAudioRoute );
+
+    for ( TInt i = 0 ; i < iRoutableAudios.Count(); i++ )
+        {
+        iRoutableAudios[i]->SetAudioRouteL( aAudioRoute );
+        }
+    iAudioRoutingObserver.AudioRouteChangedL( aAudioRoute );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CRadioAudioRouter::RegisterRoutableAudio( CRadioRoutableAudio* aRoutableAudio )
+    {
+    LOG( "CRadioAudioRouter::RegisterRoutableAudio" );
+    iRoutableAudios.Append( aRoutableAudio );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CRadioAudioRouter::UnRegisterRoutableAudio( CRadioRoutableAudio* aRoutableAudio )
+    {
+    LOG( "CRadioAudioRouter::UnRegisterRoutableAudio" );
+
+    TInt objectIndex = iRoutableAudios.Find( aRoutableAudio );
+
+    __ASSERT_DEBUG( objectIndex != KErrNotFound, User::Panic( _L("VisualRadio" ), KErrAbort ) );
+
+    if ( objectIndex != KErrNotFound )
+        {
+        iRoutableAudios.Remove( objectIndex );
+        }
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/src/cradioenginelogger.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,481 @@
+/*
+* 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:
+*
+*/
+
+// User includes
+#include "cradioenginelogger.h"
+#include "cradioenginetls.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Return the logger instance.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C MRadioEngineLogger* MRadioEngineLogger::Logger()
+    {
+    return CRadioEngineTls::Logger();
+    }
+
+#ifdef LOGGING_ENABLED
+
+#include <bautils.h>
+
+// Indentation
+_LIT( KLogSpace,    "                                " ); // 32 empty spaces
+const TInt KMaxIndent = 32;
+
+/**
+ * Timestamp formatter string
+ */
+_LIT8( KTimestampFormat, "%02d.%02d.%4d %02d:%02d:%02d.%05d" );
+
+/**
+ * Timestamp separator string
+ */
+_LIT8( KTimestampSeparator, " " );
+
+// Memory card path. Has to contain directory ( \\) or BaflUtils::PathExists fails
+_LIT( KMemoryCard, "E:\\" );
+
+_LIT( KLogEnter,     "\\ %S" );
+_LIT( KLogExit,      "/ %S" );
+_LIT8( KLogLine,     "| " );
+_LIT( KLogLeave,     "#+ %S: LEAVE!" );
+_LIT( KLogExitRet,   "/ %S, Returning " );
+
+_LIT8( KNewLine, "\r\n" );
+_LIT8( KHexFormat, "ptr: 0x%X" );
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioEngineLogger* CRadioEngineLogger::NewL( RFs& aFs )
+    {
+    CRadioEngineLogger* self = new (ELeave) CRadioEngineLogger( aFs );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioEngineLogger::CRadioEngineLogger( RFs& aFs )
+    : iFs( aFs )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineLogger::ConstructL()
+    {
+    if ( KLogFile().FindF( KMemoryCard ) == 0 )
+        {
+        TBool readOnly = EFalse;
+
+        // Returns KErrPathNotFound if memory card is not present
+        TInt err = BaflUtils::DiskIsReadOnly( iFs, KMemoryCard, readOnly );
+        if ( err || readOnly )
+            {
+            // Log file path points to the memory card and the card is not
+            // present or is read only => change the drive to C:
+            TFileName fileName( _L( "C:" ) );
+            TParsePtrC parse( KLogFile );
+            fileName.Append( parse.Path() );
+            fileName.Append( parse.NameAndExt() );
+            iFileName = fileName.AllocL();
+            }
+        }
+
+    if ( !iFileName )
+        {
+        iFileName = KLogFile().AllocL();
+        }
+
+    BaflUtils::EnsurePathExistsL( iFs, *iFileName );
+
+    User::LeaveIfError( Dll::SetTls( this ) );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioEngineLogger::~CRadioEngineLogger()
+    {
+    iFile.Close();
+    delete iFileName;
+    }
+
+// ---------------------------------------------------------------------------
+// Clear the log by deleting the logfile.
+// ---------------------------------------------------------------------------
+//
+MRadioEngineLogger& CRadioEngineLogger::ClearLog()
+    {
+    if ( BaflUtils::FileExists( iFs, *iFileName ) )
+        {
+        // Returned error code ignored intentionally because there is no way
+        // to report an error
+        BaflUtils::DeleteFile( iFs, *iFileName );
+        }
+
+    return *this;
+    }
+
+// ---------------------------------------------------------------------------
+// Adds a 8-bit string to log line
+// ---------------------------------------------------------------------------
+//
+MRadioEngineLogger& CRadioEngineLogger::Add( const TDesC8& aMsg )
+    {
+    AddDesC<TPtrC8, TDesC8>( aMsg );
+    return *this;
+    }
+
+// ---------------------------------------------------------------------------
+// Adds a 16-bit string to log line
+// ---------------------------------------------------------------------------
+//
+MRadioEngineLogger& CRadioEngineLogger::Add( const TDesC& aMsg )
+    {
+    // Note! No character conversion is performed while going from 16-bit
+    // descriptor to 8-bit descriptor. This is considered acceptable in a
+    // debugging utility
+    AddDesC<TPtrC, TDesC>( aMsg );
+    return *this;
+    }
+
+// ---------------------------------------------------------------------------
+// Adds a TInt to log line
+// ---------------------------------------------------------------------------
+//
+MRadioEngineLogger& CRadioEngineLogger::Add( TInt aInt )
+    {
+    TBuf8<20> buf8;
+    buf8.Num( aInt );
+    Add( buf8 );
+    return *this;
+    }
+
+// ---------------------------------------------------------------------------
+// Adds a TReal to log line
+// ---------------------------------------------------------------------------
+//
+MRadioEngineLogger& CRadioEngineLogger::Add( const TReal& aReal )
+    {
+    TBuf8<20> buf8;
+    buf8.Format( _L8( "%f" ), aReal );
+    Add( buf8 );
+    return *this;
+    }
+
+// ---------------------------------------------------------------------------
+// Adds a c-style string to log line
+// ---------------------------------------------------------------------------
+//
+MRadioEngineLogger& CRadioEngineLogger::Add( const char* aText )
+    {
+    Add( TPtrC8( reinterpret_cast<const TText8*>( aText ) ) );
+    return *this;
+    }
+
+// ---------------------------------------------------------------------------
+// Adds a pointer value to log line
+// ---------------------------------------------------------------------------
+//
+MRadioEngineLogger& CRadioEngineLogger::Add( const TAny* aPtr )
+    {
+    TBuf8<20> buf8;
+    buf8.Format( KHexFormat, aPtr );
+    Add( buf8 );
+    return *this;
+    }
+
+// ---------------------------------------------------------------------------
+// Adds a timestamp of current time to log line
+// ---------------------------------------------------------------------------
+//
+MRadioEngineLogger& CRadioEngineLogger::Add( const TTime& aTime )
+    {
+    TTimestamp timestamp;
+    ParseTimestamp( aTime, timestamp );
+    Add( timestamp );
+    return *this;
+    }
+
+// ---------------------------------------------------------------------------
+// Adds a timestamp of current time to log line
+// ---------------------------------------------------------------------------
+//
+MRadioEngineLogger& CRadioEngineLogger::AddTimestamp()
+    {
+    TTime now;
+    now.HomeTime();
+    return Add( now );
+    }
+
+// ---------------------------------------------------------------------------
+// Adds a formatted string to log line
+// ---------------------------------------------------------------------------
+//
+MRadioEngineLogger& CRadioEngineLogger::AddFormat( TRefByValue<const TDesC> aFmt, ... )
+    {
+    VA_LIST list;
+    VA_START( list, aFmt );
+
+    TBuf<KLogBufferLength> buf16;
+
+    // Calls Overflow() if it doesn't fit
+    buf16.AppendFormatList( aFmt, list, this );
+
+    VA_END( list );
+
+    Add( buf16 );
+    return *this;
+    }
+
+// ---------------------------------------------------------------------------
+// Adds the line indentation with line prefix to log line
+// ---------------------------------------------------------------------------
+//
+MRadioEngineLogger& CRadioEngineLogger::AddIndent( const TDesC& aMarker )
+    {
+    Add( aMarker );
+    Add( KLogSpace().Mid( 0, iIndent ) );
+    Add( KLogLine() );
+    return *this;
+    }
+
+// ---------------------------------------------------------------------------
+// Adds the line indentation to log line
+// ---------------------------------------------------------------------------
+//
+MRadioEngineLogger& CRadioEngineLogger::AddIndentClear( const TDesC& aMarker )
+    {
+    Add( aMarker );
+    Add( KLogSpace().Mid( 0, iIndent ) );
+    return *this;
+    }
+
+// ---------------------------------------------------------------------------
+// From TDes16Overflow
+// Handles the overflow from AppendFormatList()
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineLogger::Overflow( TDes16& /*aDes*/ )
+    {
+    // aDes contains the part that did fit in the descriptor, but the part that
+    // didn't is lost. Modifying the descriptor here would modify it in AddFormat(),
+    // but since it gets logged there we only need to add a message about the overflow.
+    Add( _L( "FORMAT OVERFLOW! " ) );
+    }
+
+// ---------------------------------------------------------------------------
+// Increment indentation
+// ---------------------------------------------------------------------------
+//
+MRadioEngineLogger& CRadioEngineLogger::IncIndent()
+    {
+    if ( ++iIndent > KMaxIndent )
+        {
+        iIndent = KMaxIndent;
+        }
+
+    return *this;
+    }
+
+// ---------------------------------------------------------------------------
+// Decrement indentation
+// ---------------------------------------------------------------------------
+//
+MRadioEngineLogger& CRadioEngineLogger::DecIndent()
+    {
+    if ( --iIndent < 0 )
+        {
+        iIndent = 0;
+        }
+
+    return *this;
+    }
+
+// ---------------------------------------------------------------------------
+// Commits the log line to file and RDebug and resets internal buffer
+// ---------------------------------------------------------------------------
+//
+MRadioEngineLogger& CRadioEngineLogger::Commit( TBool aNewLine )
+    {
+    // Write log buffer to RDebug
+    RDebug::RawPrint( iBuf8 );
+
+    // Write log buffer to file
+    TInt err = iFile.Open( iFs, *iFileName, EFileWrite );
+    if ( err )
+        {
+        err = iFile.Create( iFs, *iFileName, EFileWrite );
+        }
+
+    if ( !err )
+        {
+        TInt unused = 0;
+        if ( iFile.Seek( ESeekEnd, unused ) == KErrNone )
+            {
+            if ( !iTimeStampWritten )
+                {
+                // First print a timestamp to log
+                TTimestamp timestamp;
+                TTime now;
+                now.HomeTime();
+                ParseTimestamp( now, timestamp );
+                iFile.Write( timestamp );
+                iFile.Write( KTimestampSeparator );
+                iTimeStampWritten = ETrue;
+                }
+
+            iFile.Write( iBuf8 );
+
+            if ( aNewLine )
+                {
+                iFile.Write( KNewLine );
+                iTimeStampWritten = EFalse;
+                }
+            }
+
+        iFile.Close();
+        }
+
+    iBuf8.Zero();
+    return *this;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the amount of characters that still fit in the buffer
+// ---------------------------------------------------------------------------
+//
+TInt CRadioEngineLogger::Available() const
+    {
+    return iBuf8.MaxLength() - iBuf8.Length();
+    }
+
+// ---------------------------------------------------------------------------
+// Templated function to add either 8-bit or 16-bit descriptor to buffer
+// ---------------------------------------------------------------------------
+//
+template<class PTR, class DESC>
+void CRadioEngineLogger::AddDesC( const DESC& aDesc )
+    {
+    PTR ptr( aDesc );
+    while ( ptr.Length() > Available() )
+        {
+        PTR writePtr = ptr.Left( Available() );
+        iBuf8.Append( writePtr );
+
+        ptr.Set( ptr.Mid( writePtr.Length() ) );
+        Commit( EFalse );
+        }
+
+    iBuf8.Append( ptr );
+    }
+
+// ---------------------------------------------------------------------------
+// Parses the timestamp from the given TTime
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineLogger::ParseTimestamp( const TTime& aTime, TTimestamp& aTimestamp )
+    {
+    TDateTime dateTime = aTime.DateTime();
+    aTimestamp.Zero();
+    aTimestamp.Format( KTimestampFormat, dateTime.Day() + 1,
+                                         dateTime.Month() + 1,
+                                         dateTime.Year(),
+                                         dateTime.Hour(),
+                                         dateTime.Minute(),
+                                         dateTime.Second(),
+                                         dateTime.MicroSecond() );
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor. Log method entry
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TRadioMethodLogger::TRadioMethodLogger( const TText* aFunc,
+                                                 const TText* aRetFormat )
+    : iFunc( aFunc )
+    , iRetFormat( aRetFormat )
+    {
+    MRadioEngineLogger* logger = MRadioEngineLogger::Logger();
+    logger->AddIndentClear( KMarkerEngine ).AddFormat( KLogEnter, &iFunc ).Commit();
+    logger->IncIndent();
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor. Log method exit
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TRadioMethodLogger::~TRadioMethodLogger()
+    {
+    MRadioEngineLogger::Logger()->DecIndent();
+
+    if ( std::uncaught_exception() ) // Leave is an exception
+        {
+        // The function exited with a leave
+        MRadioEngineLogger::Logger()->AddIndentClear( KMarkerEngine ).AddFormat( KLogLeave, &iFunc ).Commit();
+        }
+    else
+        {
+        // The function exited normally
+        if ( iRetFormat.Length() == 0 )
+            {
+            MRadioEngineLogger::Logger()->AddIndentClear( KMarkerEngine ).AddFormat( KLogExit, &iFunc ).Commit();
+            }
+        else
+            {
+            TBuf<100> format( KLogExitRet );
+            format.Append( iRetFormat );
+            #if defined( __WINS__ )
+
+                TInt32 retVal = 0;
+                _asm( mov retVal, ebx );
+                MRadioEngineLogger::Logger()->AddIndentClear( KMarkerEngine ).AddFormat( format, &iFunc, retVal ).Commit();
+
+            #else
+
+                MRadioEngineLogger::Logger()->AddIndentClear( KMarkerEngine ).AddFormat( KLogExit, &iFunc ).Commit();
+
+            #endif
+            }
+        }
+    }
+
+#else // #ifdef LOGGING_ENABLED
+
+// ===========================================================================
+// Dummy function definitions to keep the exports unchanged when logging is turned off
+// These can not be used.
+// ===========================================================================
+EXPORT_C TRadioMethodLogger::TRadioMethodLogger( const TText*, const TText* ) {}
+EXPORT_C TRadioMethodLogger::~TRadioMethodLogger() {}
+
+#endif // #ifdef LOGGING_ENABLED
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/src/cradioenginetls.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,168 @@
+/*
+* 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:
+*
+*/
+
+// System includes
+#include <coemain.h>
+#include <e32svr.h>
+
+// User includes
+#include "cradioenginelogger.h"
+#include "cradioenginetls.h"
+
+const int KUidRadioEngineTls = 0x10281CB8;
+
+// ======== MEMBER FUNCTIONS ========
+
+
+// ---------------------------------------------------------------------------
+// Returns the CRadioEngineTls instance from TLS
+// ---------------------------------------------------------------------------
+//
+CRadioEngineTls& CRadioEngineTls::Instance()
+    {
+    return *static_cast<CRadioEngineTls*>( UserSvr::DllTls( KUidRadioEngineTls ) );
+    }
+
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineTls::InitializeL( CCoeEnv* aEnv, RFs* aFs )
+    {
+    if ( !UserSvr::DllTls( KUidRadioEngineTls ) )
+        {
+        CRadioEngineTls* self = new ( ELeave ) CRadioEngineTls( aEnv, aFs );
+        CleanupStack::PushL( self );
+        self->ConstructL();
+        User::LeaveIfError( UserSvr::DllSetTls( KUidRadioEngineTls, self ) );
+        CleanupStack::Pop( self );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioEngineTls::CRadioEngineTls( CCoeEnv* aEnv, RFs* aFs )
+    : iEnv( aEnv )
+    , iFs( aFs )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineTls::ConstructL()
+    {
+    if ( !iEnv )
+        {
+        iEnv = CCoeEnv::Static();
+        }
+
+    if ( !iFs )
+        {
+        iFsOwned = ETrue;
+        iFs = new ( ELeave ) RFs;
+        User::LeaveIfError( iFs->Connect() );
+        }
+
+#ifdef LOGGING_ENABLED
+    iLogger = CRadioEngineLogger::NewL( *iFs );
+#endif // LOGGING_ENABLED
+
+    }
+
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioEngineTls::~CRadioEngineTls()
+    {
+    UserSvr::DllFreeTls( KUidRadioEngineTls );
+
+#ifdef LOGGING_ENABLED
+    delete iLogger;
+#endif
+
+    if ( iFs && iFsOwned )
+        {
+        iFs->Close();
+        delete iFs;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// Return the logger storage if logging is enabled
+// ---------------------------------------------------------------------------
+//
+MRadioEngineLogger* CRadioEngineTls::Logger()
+    {
+#ifdef LOGGING_ENABLED
+    return CRadioEngineTls::Instance().iLogger;
+#else
+    return NULL;
+#endif
+    }
+
+
+// ---------------------------------------------------------------------------
+// Return the eikon environment
+// ---------------------------------------------------------------------------
+//
+CCoeEnv* CRadioEngineTls::Env()
+    {
+    return CRadioEngineTls::Instance().iEnv;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Returns the file server session
+// ---------------------------------------------------------------------------
+//
+RFs& CRadioEngineTls::FsSession()
+    {
+    return *CRadioEngineTls::Instance().iFs;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CRadioEngineTls::AddRef
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineTls::AddRef()
+    {
+    ++iRefs;
+    }
+
+// ---------------------------------------------------------------------------
+// CRadioEngineTls::Release
+// ---------------------------------------------------------------------------
+//
+void CRadioEngineTls::Release()
+    {
+    __ASSERT_DEBUG( iRefs > 0 , User::Panic( _L( "CRadioEngineTls" ), KErrCorrupt ) );
+    if ( !--iRefs )
+        {
+        delete this;
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/src/cradiopropertyobserver.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,204 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "cradioenginelogger.h"
+
+#include "cradiopropertyobserver.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+CRadioPropertyObserver::CRadioPropertyObserver( MRadioPropertyChangeObserver& aObserver,
+                                                const TUid& aCategory,
+                                                const TUint aKey,
+                                                const TRadioPropertyType aPropertyType )
+    : CActive( CActive::EPriorityStandard )
+    , iObserver( aObserver )
+    , iCategory( aCategory )
+    , iKey( aKey )
+    , iPropertyType( aPropertyType )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CRadioPropertyObserver::ConstructL()
+    {
+    switch ( iPropertyType )
+        {
+        case ERadioPropertyInt:
+            {
+            break;
+            }
+        case ERadioPropertyByteArray:
+            {
+            iValueByteArray = HBufC8::NewL( RProperty::KMaxPropertySize );
+            break;
+            }
+        case ERadioPropertyText:
+            {
+            // Max size in bytes, length is size / 2
+            iValueText = HBufC::NewL( RProperty::KMaxPropertySize / 2 );
+            break;
+            }
+        default:
+            {
+            break;
+            }
+        }
+
+    User::LeaveIfError( iProperty.Attach( iCategory, iKey ) );
+    CActiveScheduler::Add( this );
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CRadioPropertyObserver* CRadioPropertyObserver::NewL( MRadioPropertyChangeObserver& aObserver,
+                                                               const TUid& aCategory,
+                                                               const TUint aKey,
+                                                               const TRadioPropertyType aPropertyType )
+    {
+    CRadioPropertyObserver* self = new( ELeave )CRadioPropertyObserver( aObserver,
+                                            aCategory, aKey, aPropertyType );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+CRadioPropertyObserver::~CRadioPropertyObserver()
+    {
+    Cancel();
+    iProperty.Close();
+    delete iValueByteArray;
+    delete iValueText;
+    }
+
+// ---------------------------------------------------------------------------
+// Subscribes to a property and reads the value, if not already active.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CRadioPropertyObserver::ActivateL()
+    {
+    if ( !IsActive() )
+        {
+        RunL();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CRadioPropertyObserver::RunL()
+    {
+    LOG_METHOD_AUTO;
+
+    iProperty.Subscribe( iStatus );
+    SetActive();
+
+    TInt err( KErrNone );
+
+    switch ( iPropertyType )
+        {
+        case ERadioPropertyInt:
+            {
+            err = iProperty.Get( iValueInt );
+            if ( !err )
+                {
+                iObserver.HandlePropertyChangeL( iCategory, iKey, iValueInt );
+                }
+            break;
+            }
+        case ERadioPropertyByteArray:
+            {
+            TPtr8 ptr8( iValueByteArray->Des() );
+            err = iProperty.Get( ptr8 );
+            if ( !err )
+                {
+                iObserver.HandlePropertyChangeL( iCategory, iKey, *iValueByteArray );
+                }
+            break;
+            }
+        case ERadioPropertyText:
+            {
+            TPtr ptr( iValueText->Des() );
+            err = iProperty.Get( ptr );
+            if ( !err )
+                {
+                iObserver.HandlePropertyChangeL( iCategory, iKey, *iValueText );
+                }
+            break;
+            }
+        default:
+            {
+            break;
+            }
+        }
+
+    if ( err )
+        {
+        iObserver.HandlePropertyChangeErrorL( iCategory, iKey, err );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// Cancels an outstanding active request
+// -----------------------------------------------------------------------------
+//
+void CRadioPropertyObserver::DoCancel()
+    {
+    iProperty.Cancel();
+    }
+
+// -----------------------------------------------------------------------------
+// Getter for integer value
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CRadioPropertyObserver::ValueInt() const
+    {
+    return iValueInt;
+    }
+
+// -----------------------------------------------------------------------------
+// Getter for byte array value
+// -----------------------------------------------------------------------------
+//
+EXPORT_C const TDesC8& CRadioPropertyObserver::ValueDes8() const
+    {
+    return *iValueByteArray;
+    }
+
+// -----------------------------------------------------------------------------
+// Getter for text value
+// -----------------------------------------------------------------------------
+//
+EXPORT_C const TDesC& CRadioPropertyObserver::ValueDes() const
+    {
+    return *iValueText;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/src/cradiopubsub.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "cradiopubsub.h"
+#include "cradiopubsubimp.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CRadioPubSub* CRadioPubSub::NewL()
+    {
+    return CRadioPubSubImp::NewL();
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CRadioPubSub::~CRadioPubSub()
+    {
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/src/cradiopubsubimp.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,562 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "radiouid.hrh"
+
+#include "cradioenginelogger.h"
+#include "radiointernalpskeys.h"
+
+#include "mradiocontroleventobserver.h"
+#include "cradiopubsub.h"
+#include "cradiopubsubimp.h"
+#include "radioengineutils.h"
+
+// This has to be the last include. 
+#ifdef STUB_CONSTELLATION
+#   include "RadioStubManager.h"
+#   define KRadioPSUid KStub_KRadioPSUid
+#endif //STUB_CONSTELLATION
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioPubSubImp::CRadioPubSubImp()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioPubSubImp::ConstructL()
+    {
+    RadioEngineUtils::InitializeL();
+    LOG_METHOD_AUTO;
+
+    // Define data properties.
+    DefinePropertyL( KRadioPSDataChannel,               RProperty::EInt,    ETrue );
+    DefinePropertyL( KRadioPSDataFrequency,             RProperty::EInt,    ETrue );
+    DefinePropertyL( KRadioPSDataRadioPowerState,       RProperty::EInt,    ETrue );
+    DefinePropertyL( KRadioPSDataVolume,                RProperty::EInt,    ETrue );
+    DefinePropertyL( KRadioPSDataChannelDataChanged,    RProperty::EInt,    ETrue );
+    DefinePropertyL( KRadioPSDataTuningState,           RProperty::EInt,    ETrue );
+    DefinePropertyL( KRadioPSDataRadioMuteState,        RProperty::EInt,    ETrue );
+    DefinePropertyL( KRadioPSDataApplicationRunning,    RProperty::EInt,    ETrue );
+    DefinePropertyL( KRadioPSDataHeadsetStatus,         RProperty::EInt,    ETrue );
+    DefinePropertyL( KRadioPSDataFrequencyDecimalCount, RProperty::EInt,    ETrue );
+    DefinePropertyL( KRadioPSDataLoudspeakerStatus,     RProperty::EInt,    ETrue );
+    DefinePropertyL( KRadioPSDataRdsProgramService,     RProperty::EText,   ETrue );
+    DefinePropertyL( KRadioPSDataRdsRadioText,          RProperty::EText,   ETrue );
+    DefinePropertyL( KRadioPSDataChannelName,           RProperty::EText,   ETrue );
+    DefinePropertyL( KRadioPSDataActivePresetListCount, RProperty::EInt,    ETrue );
+    DefinePropertyL( KRadioPSDataActivePresetListFocus, RProperty::EInt,    ETrue );
+    DefinePropertyL( KRadioPSDataRadioAntennaState,     RProperty::EInt,    ETrue );
+
+    // Define control properties.
+    DefinePropertyL( KRadioPSControlStepToChannel,      RProperty::EInt, EFalse );
+    DefinePropertyL( KRadioPSControlSetChannel,         RProperty::EInt, EFalse );
+    DefinePropertyL( KRadioPSControlSeek,               RProperty::EInt, EFalse );
+    DefinePropertyL( KRadioPSControlStepToFrequency,    RProperty::EInt, EFalse );
+    DefinePropertyL( KRadioPSControlSetFrequency,       RProperty::EInt, EFalse );
+    DefinePropertyL( KRadioPSControlAdjustVolume ,      RProperty::EInt, EFalse );
+    DefinePropertyL( KRadioPSControlSetRadioMuteState,  RProperty::EInt, EFalse );
+    DefinePropertyL( KRadioPSControlSetAudioOutput,     RProperty::EInt, EFalse );
+
+    // Observe control properties.
+    CreatePropertyObserverL( KRadioPSControlStepToChannel,      CRadioPropertyObserver::ERadioPropertyInt );
+    CreatePropertyObserverL( KRadioPSControlSetChannel,         CRadioPropertyObserver::ERadioPropertyInt );
+    CreatePropertyObserverL( KRadioPSControlSeek,               CRadioPropertyObserver::ERadioPropertyInt );
+    CreatePropertyObserverL( KRadioPSControlStepToFrequency,    CRadioPropertyObserver::ERadioPropertyInt );
+    CreatePropertyObserverL( KRadioPSControlSetFrequency,       CRadioPropertyObserver::ERadioPropertyInt );
+    CreatePropertyObserverL( KRadioPSControlAdjustVolume,       CRadioPropertyObserver::ERadioPropertyInt );
+    CreatePropertyObserverL( KRadioPSControlSetRadioMuteState,  CRadioPropertyObserver::ERadioPropertyInt );
+    CreatePropertyObserverL( KRadioPSControlSetAudioOutput,     CRadioPropertyObserver::ERadioPropertyInt );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioPubSubImp* CRadioPubSubImp::NewL()
+    {
+    CRadioPubSubImp* self = new ( ELeave ) CRadioPubSubImp();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioPubSubImp::~CRadioPubSubImp()
+    {
+    iPropertyArray.ResetAndDestroy();
+
+    DeleteProperty( KRadioPSDataChannel );
+    DeleteProperty( KRadioPSDataFrequency );
+    DeleteProperty( KRadioPSDataRadioPowerState );
+    DeleteProperty( KRadioPSDataVolume );
+    DeleteProperty( KRadioPSDataChannelDataChanged );
+    DeleteProperty( KRadioPSDataTuningState );
+    DeleteProperty( KRadioPSDataRadioMuteState );
+    DeleteProperty( KRadioPSDataApplicationRunning );
+    DeleteProperty( KRadioPSDataHeadsetStatus );
+    DeleteProperty( KRadioPSDataFrequencyDecimalCount );
+    DeleteProperty( KRadioPSDataLoudspeakerStatus );
+    DeleteProperty( KRadioPSDataRdsProgramService );
+    DeleteProperty( KRadioPSDataRdsRadioText );
+    DeleteProperty( KRadioPSDataChannelName );
+    DeleteProperty( KRadioPSDataActivePresetListCount );
+    DeleteProperty( KRadioPSDataActivePresetListFocus );
+    DeleteProperty( KRadioPSDataRadioAntennaState );
+
+    DeleteProperty( KRadioPSControlStepToChannel );
+    DeleteProperty( KRadioPSControlSetChannel );
+    DeleteProperty( KRadioPSControlSeek );
+    DeleteProperty( KRadioPSControlStepToFrequency );
+    DeleteProperty( KRadioPSControlSetFrequency );
+    DeleteProperty( KRadioPSControlAdjustVolume );
+    DeleteProperty( KRadioPSControlSetRadioMuteState );
+    DeleteProperty( KRadioPSControlSetAudioOutput );
+
+    RadioEngineUtils::Release();
+    }
+
+// ---------------------------------------------------------------------------
+// Defines a property.
+// ---------------------------------------------------------------------------
+//
+void CRadioPubSubImp::DefinePropertyL( TUint aKey, TInt aAttr, TBool aDataProperty ) const
+    {
+    _LIT_SECURITY_POLICY_PASS( KRadioExternalAccessPolicy );
+    _LIT_SECURITY_POLICY_S0( KRadioInternalAccessPolicy, KUidRadioApplication );
+
+    TInt err = KErrNone;
+    if ( aDataProperty )
+        {
+        // For data properties, grant read access for all, but write access only for radio application
+        err = RProperty::Define( KRadioPSUid, aKey, aAttr, KRadioExternalAccessPolicy, KRadioInternalAccessPolicy );
+        }
+    else
+        {
+        // For control properties, grant read access only for radio application, but write access for all
+        err = RProperty::Define( KRadioPSUid, aKey, aAttr, KRadioInternalAccessPolicy, KRadioExternalAccessPolicy );
+        }
+
+    if ( err && err != KErrAlreadyExists )
+        {
+        LOG_FORMAT( "CRadioPubSubImp::DefinePropertyL: Leaving with %d", err );
+        User::Leave( err );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Deletes a property
+// ---------------------------------------------------------------------------
+//
+void CRadioPubSubImp::DeleteProperty( TUint aKey ) const
+    {
+    RProperty::Delete( KRadioPSUid, aKey );
+    }
+
+// ---------------------------------------------------------------------------
+// Creates a property observer
+// ---------------------------------------------------------------------------
+//
+void CRadioPubSubImp::CreatePropertyObserverL( const TUint aKey,
+                                               const TInt aPropertyType )
+    {
+    CRadioPropertyObserver* observer = CRadioPropertyObserver::NewL( *this, KRadioPSUid,
+                    aKey, static_cast<CRadioPropertyObserver::TRadioPropertyType>( aPropertyType ) );
+
+    if ( iPropertyArray.Append( observer ) == KErrNone )
+        {
+        observer->ActivateL();
+        }
+    else
+        {
+        delete observer;
+        observer = NULL;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Gets the integer value stored in a property.
+// ---------------------------------------------------------------------------
+//
+TBool CRadioPubSubImp::Get( TUint aKey, TInt& aValue ) const
+    {
+    return RProperty::Get( KRadioPSUid, aKey, aValue ) == KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets a property's value.
+// ---------------------------------------------------------------------------
+//
+TBool CRadioPubSubImp::Set( TUint aKey, TInt aValue ) const
+    {
+    return RProperty::Set( KRadioPSUid, aKey, aValue ) == KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets a text property value
+// ---------------------------------------------------------------------------
+//
+TBool CRadioPubSubImp::Set( TUint aKey, const TDesC& aValue ) const
+    {
+    return RProperty::Set( KRadioPSUid, aKey, aValue ) == KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioPubSubImp::HandlePropertyChangeL( const TUid& aCategory,
+                                             const TUint aKey,
+                                             const TInt aValue )
+    {
+    LOG_FORMAT( "CRadioPubSubImp::HandlePropertyChangeL: Category: %d, Key: %u. Value: %d",
+                                                aCategory.iUid, aKey, aValue );
+
+    if ( aCategory != KRadioPSUid )
+        {
+        LOG( "CRadioPubSubImp::HandlePropertyChangeL: Unknown category. Leaving" );
+        User::Leave( KErrArgument );
+        }
+
+    if ( !iObserver )
+        {
+        return;
+        }
+
+    if ( aKey == KRadioPSControlStepToChannel )
+        {
+        if ( aValue == ERadioPSStepToChannelUp )
+            {
+            iObserver->StepToChannelL( RadioEngine::ERadioUp );
+            }
+        else if ( aValue == ERadioPSStepToChannelDown )
+            {
+            iObserver->StepToChannelL( RadioEngine::ERadioDown );
+            }
+        }
+    else if ( aKey == KRadioPSControlSetChannel )
+        {
+        if ( aValue > 0 )
+            {
+            iObserver->SetChannelL( aValue );
+            }
+        }
+    else if ( aKey == KRadioPSControlSeek )
+        {
+        if ( aValue == ERadioPSSeekUp )
+            {
+            iObserver->SeekL( RadioEngine::ERadioUp );
+            }
+        else if ( aValue == ERadioPSSeekDown )
+            {
+            iObserver->SeekL( RadioEngine::ERadioDown );
+            }
+        }
+    else if ( aKey == KRadioPSControlStepToFrequency )
+        {
+        if ( aValue == ERadioPSStepToFrequencyUp )
+            {
+            iObserver->StepToFrequencyL( RadioEngine::ERadioUp );
+            }
+        else if ( aValue == ERadioPSStepToFrequencyDown )
+            {
+            iObserver->StepToFrequencyL( RadioEngine::ERadioDown );
+            }
+        }
+    else if ( aKey == KRadioPSControlSetFrequency )
+        {
+        if ( aValue > 0 )
+            {
+            iObserver->SetFrequencyL( aValue );
+            }
+        }
+    else if ( aKey == KRadioPSControlAdjustVolume )
+        {
+        if ( aValue == ERadioPSIncreaseVolume )
+            {
+            iObserver->AdjustVolumeL( RadioEngine::ERadioIncVolume );
+            }
+        else if ( aValue == ERadioPSDecreaseVolume )
+            {
+            iObserver->AdjustVolumeL( RadioEngine::ERadioDecVolume );
+            }
+        }
+    else if ( aKey == KRadioPSControlSetRadioMuteState )
+        {
+        if ( aValue == ERadioPSMuteStateOn )
+            {
+            iObserver->MuteL( ETrue );
+            }
+        else if ( aValue == ERadioPSMuteStateOff )
+            {
+            iObserver->MuteL( EFalse );
+            }
+        }
+    else if ( aKey == KRadioPSControlSetAudioOutput )
+        {
+        if ( aValue == ERadioPSAudioOutputHeadset )
+            {
+            iObserver->SetAudioRouteL( RadioEngine::ERadioHeadset );
+            }
+        else if ( aValue == ERadioPSAudioOutputSpeaker )
+            {
+            iObserver->SetAudioRouteL( RadioEngine::ERadioSpeaker );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioPubSubImp::PublishChannel( TInt aChannelId ) const
+    {
+    LOG_FORMAT( "CRadioPubSubImp::PublishChannel ( aChannelId = %d )", aChannelId );
+
+    TInt oldChannelId = 0;
+    if ( Get( KRadioPSDataChannel, oldChannelId ) && aChannelId != oldChannelId )
+        {
+        return Set( KRadioPSDataChannel, aChannelId );
+        }
+    return EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioPubSubImp::PublishFrequency( TUint32 aFreq ) const
+    {
+    LOG_FORMAT( "CRadioPubSubImp::PublishFrequency ( aFreq = %u )", aFreq );
+
+    TInt oldFreq = 0;
+    if ( Get( KRadioPSDataFrequency, oldFreq ) && aFreq != oldFreq )
+        {
+        return Set( KRadioPSDataFrequency, aFreq );
+        }
+    return EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioPubSubImp::PublishPowerState( TBool aPowerOn ) const
+    {
+    LOG_FORMAT( "CRadioPubSubImp::PublishStateL ( aPowerOn = %d )", aPowerOn );
+    // If VR process gets killed, power on state remains published.
+    // Must not compare state transition here, because then power on might not be published.
+    TRadioPSRadioPowerState newState = aPowerOn ? ERadioPSRadioPowerOn : ERadioPSRadioPowerOff;
+    return Set( KRadioPSDataRadioPowerState, newState );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioPubSubImp::PublishVolume( TInt aVol ) const
+    {
+    LOG_FORMAT( "CRadioPubSubImp::PublishVolume ( aVol = %d )", aVol );
+
+    TInt oldVol = 0;
+    if ( Get( KRadioPSDataVolume, oldVol ) && aVol != oldVol )
+        {
+        return Set( KRadioPSDataVolume, aVol );
+        }
+    return EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioPubSubImp::PublishChannelDataChanged( TInt aChannelId ) const
+    {
+    LOG_FORMAT( "CRadioPubSubImp::PublishChannelDataChangedL ( aChannelId = %d )", aChannelId );
+
+    // Channel data changed notifications are allowed for the same channel multiple times, as the same channel's
+    // data can be changed many times in a row.
+
+    return Set( KRadioPSDataChannelDataChanged, aChannelId );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioPubSubImp::PublishTuningState( TRadioPSTuningState aTuningState ) const
+    {
+    LOG_FORMAT( "CRadioPubSubImp::PublishSeekingStateL ( aTuningState = %d )", aTuningState );
+
+    TInt oldState = 0;
+    if ( Get( KRadioPSDataTuningState, oldState ) && aTuningState != oldState )
+        {
+        return Set( KRadioPSDataTuningState, aTuningState );
+        }
+    return EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioPubSubImp::PublishRadioMuteState( TBool aMuted ) const
+    {
+    LOG_FORMAT( "CRadioPubSubImp::PublishMuteStateL ( aMuted = %d )", aMuted );
+
+    TRadioPSRadioMuteState newState = aMuted ? ERadioPSMuteStateOn : ERadioPSMuteStateOff;
+
+    TInt oldState = 0;
+    if ( Get( KRadioPSDataRadioMuteState, oldState ) && oldState != newState )
+        {
+        return Set( KRadioPSDataRadioMuteState, newState );
+        }
+    return EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioPubSubImp::PublishApplicationRunningState( TRadioPSApplicationRunningState aRunningState ) const
+    {
+    LOG_FORMAT( "CRadioPubSubImp::PublishApplicationRunningStateL ( aRunningState = %d )", aRunningState );
+    // If VR process gets killed, wrong running state remains published.
+    // Must not compare state transition here, because then application start might not be published.
+    return Set( KRadioPSDataApplicationRunning, aRunningState );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioPubSubImp::PublishHeadsetStatus( TRadioPSHeadsetStatus aHeadsetStatus ) const
+    {
+    LOG_FORMAT( "CRadioPubSubImp::PublishHeadsetStatusL ( aHeadsetStatus = %d )", aHeadsetStatus );
+
+    TInt oldStatus = 0;
+    if ( Get( KRadioPSDataHeadsetStatus, oldStatus ) && aHeadsetStatus != oldStatus )
+        {
+        return Set( KRadioPSDataHeadsetStatus, aHeadsetStatus );
+        }
+    return EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioPubSubImp::PublishFrequencyDecimalCount( TRadioPSFrequencyDecimalCount aDecimalCount ) const
+    {
+    LOG_FORMAT( "CRadioPubSubImp::PublishFrequencyDecimalCountL ( aDecimalCount = %d )", aDecimalCount );
+
+    TInt oldCount = 0;
+    if ( Get( KRadioPSDataFrequencyDecimalCount, oldCount ) && aDecimalCount != oldCount )
+        {
+        return Set( KRadioPSDataFrequencyDecimalCount, aDecimalCount );
+        }
+    return EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioPubSubImp::PublishLoudspeakerStatus( TRadioPSLoudspeakerStatus aLoudspeakerStatus ) const
+    {
+    LOG_FORMAT( "CRadioPubSubImp::PublishLoudspeakerStatusL ( aLoudspeakerStatus = %d )", aLoudspeakerStatus );
+    TInt oldStatus = 0;
+    if ( Get( KRadioPSDataLoudspeakerStatus, oldStatus ) && oldStatus != aLoudspeakerStatus )
+        {
+        return Set( KRadioPSDataLoudspeakerStatus, aLoudspeakerStatus );
+        }
+    return EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioPubSubImp::PublishRdsProgramService( const TDesC& aProgramService ) const
+    {
+    return Set( KRadioPSDataRdsProgramService, aProgramService );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioPubSubImp::PublishRdsRadioText( const TDesC& aRadioText ) const
+    {
+    return Set( KRadioPSDataRdsRadioText, aRadioText );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioPubSubImp::PublishChannelName( const TDesC& aName ) const
+    {
+    return Set( KRadioPSDataChannelName, aName );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioPubSubImp::PublishActivePreseListCount( TInt aCount ) const
+    {
+    return Set( KRadioPSDataActivePresetListCount, aCount );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioPubSubImp::PublishActivePreseListFocus( TInt aIndex ) const
+    {
+    return Set( KRadioPSDataActivePresetListFocus, aIndex );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioPubSubImp::PublishAntennaState( TRadioPSRadioAntennaState aState ) const
+    {
+    return Set( KRadioPSDataRadioAntennaState, aState );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioPubSubImp::SetControlEventObserver( MRadioControlEventObserver* aControlEventObserver )
+    {
+    iObserver = aControlEventObserver;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/src/cradioremcontarget.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+// User includes
+#include "cradioremcontarget.h"
+#include "cradioremcontargetimp.h"
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CRadioRemConTarget* CRadioRemConTarget::NewL()
+    {
+    return CRadioRemConTargetImp::NewL();
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioRemConTarget::~CRadioRemConTarget()
+    {
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/src/cradioremcontargetimp.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,436 @@
+/*
+* 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:
+*
+*/
+
+// System includes
+#include <RemConCallHandlingTarget.h>
+#include <remconcoreapitarget.h>
+#include <remconinterfaceselector.h>
+
+// User includes
+#include "cradioenginelogger.h"
+#include "cradioremcontargetimp.h"
+#include "mradiocontroleventobserver.h"
+#include "radioengineutils.h"
+
+// Constants
+const TInt KVRVolumeTimerInitialDelay = 1000000; // Initial timer for headset volume up/down press event should expire immediately
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioRemConTargetImp::CRadioRemConTargetImp()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRemConTargetImp::ConstructL()
+    {
+    RadioEngineUtils::InitializeL();
+    // Create interface selector.
+    iInterfaceSelector = CRemConInterfaceSelector::NewL();
+    // Create a new CRemConCoreApiTarget, owned by the interface selector.
+    iCoreTarget = CRemConCoreApiTarget::NewL( *iInterfaceSelector, *this );
+    // Create a new CRemConCallHandlingTarget, owned by the interface selector.
+    iCallTarget = CRemConCallHandlingTarget::NewL( *iInterfaceSelector, *this );
+    // Start being a target.
+    iInterfaceSelector->OpenTargetL();
+    // Create repeat timer.
+    iRepeatTimer = CPeriodic::NewL( CActive::EPriorityStandard );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioRemConTargetImp* CRadioRemConTargetImp::NewL()
+    {
+    CRadioRemConTargetImp* self = new ( ELeave ) CRadioRemConTargetImp();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioRemConTargetImp::~CRadioRemConTargetImp()
+    {
+    if ( iRepeatTimer )
+        {
+        iRepeatTimer->Cancel();
+        }
+    delete iRepeatTimer;
+    delete iInterfaceSelector; //deletes also iCallTarget and iCoreTarget
+    iCoreTarget = NULL;
+    iCallTarget = NULL;
+    RadioEngineUtils::Release();
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRemConTargetImp::SetControlEventObserver( MRadioControlEventObserver* aControlEventObserver )
+    {
+    iObserver = aControlEventObserver;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRemConTargetImp::MrccatoCommand( TRemConCoreApiOperationId aOperationId,
+                                         TRemConCoreApiButtonAction aButtonAct )
+    {
+    LOG_FORMAT( "CRadioRemConTargetImp::MrccatoCommand ( aOperationId = %d, aButtonAct = %d )", aOperationId, aButtonAct );
+    //TODO: Refactor
+    if ( iObserver )
+        {
+        switch ( aOperationId )
+            {
+            case ERemConCoreApiChannelUp:
+                {
+                if ( aButtonAct == ERemConCoreApiButtonClick )
+                    {
+                    TRAP_IGNORE( iObserver->ChannelUpL( ETrue ); iObserver->ChannelUpL( EFalse ));
+                    }
+                else if ( aButtonAct == ERemConCoreApiButtonPress )
+                    {
+                    TRAP_IGNORE( iObserver->ChannelUpL( ETrue ));
+                    }
+                else if ( aButtonAct == ERemConCoreApiButtonRelease )
+                    {
+                    TRAP_IGNORE( iObserver->ChannelUpL( EFalse ));
+                    }
+                else {}
+                break;
+                }
+            case ERemConCoreApiChannelDown:
+                {
+                if ( aButtonAct == ERemConCoreApiButtonClick )
+                    {
+                    TRAP_IGNORE( iObserver->ChannelDownL( ETrue ); iObserver->ChannelDownL( EFalse ));
+                    }
+                else if ( aButtonAct == ERemConCoreApiButtonPress )
+                    {
+                    TRAP_IGNORE( iObserver->ChannelDownL( ETrue ));
+                    }
+                else if ( aButtonAct == ERemConCoreApiButtonRelease )
+                    {
+                    TRAP_IGNORE( iObserver->ChannelDownL( EFalse ));
+                    }
+                else {}
+                break;
+                }
+            case ERemConCoreApiVolumeUp:
+                {
+                if ( aButtonAct == ERemConCoreApiButtonClick )
+                    {
+                    TRAP_IGNORE( iObserver->VolumeUpL( ETrue ); iObserver->VolumeUpL( EFalse ));
+                    }
+                else if ( aButtonAct == ERemConCoreApiButtonPress )
+                    {
+                    iRepeatTimer->Cancel();
+                    iRepeatId = ERemConCoreApiVolumeUp;
+                    iRepeatTimer->Start( KVRVolumeTimerInitialDelay, KVRVolumeTimerInitialDelay, TCallBack( RepeatTimerCallback, this ));
+                    TRAP_IGNORE( iObserver->VolumeUpL( ETrue ); iObserver->VolumeUpL( EFalse ));
+                    }
+                else if ( aButtonAct == ERemConCoreApiButtonRelease )
+                    {
+                    iRepeatTimer->Cancel();
+                    }
+                else {}
+                break;
+                }
+            case ERemConCoreApiVolumeDown:
+                {
+                if ( aButtonAct == ERemConCoreApiButtonClick )
+                    {
+                    TRAP_IGNORE( iObserver->VolumeDownL( ETrue ); iObserver->VolumeDownL( EFalse ));
+                    }
+                else if ( aButtonAct == ERemConCoreApiButtonPress )
+                    {
+                    iRepeatTimer->Cancel();
+                    iRepeatId = ERemConCoreApiVolumeDown;
+                    iRepeatTimer->Start( KVRVolumeTimerInitialDelay, KVRVolumeTimerInitialDelay, TCallBack( RepeatTimerCallback, this ));
+                    TRAP_IGNORE( iObserver->VolumeDownL( ETrue ); iObserver->VolumeDownL( EFalse ));
+                    }
+                else if ( aButtonAct == ERemConCoreApiButtonRelease )
+                    {
+                    iRepeatTimer->Cancel();
+                    }
+                else {}
+                break;
+                }
+            case ERemConCoreApiStop:
+                {
+                if ( aButtonAct == ERemConCoreApiButtonClick )
+                    {
+                    TRAP_IGNORE( iObserver->StopL( ETrue ); iObserver->StopL( EFalse ));
+                    }
+                break;
+                }
+            case ERemConCoreApiBackward:
+                {
+                if( aButtonAct == ERemConCoreApiButtonClick )
+                    {
+                    TRAP_IGNORE( iObserver->BackwardL( ETrue ); iObserver->BackwardL( EFalse ));
+                    }
+                break;
+                }
+            case ERemConCoreApiRewind:
+                {
+                if ( aButtonAct == ERemConCoreApiButtonPress )
+                    {
+                    LOG( "ERemConCoreApiRewind" );
+                    TRAP_IGNORE( iObserver->RewindL( ETrue ));
+                    }
+                else if ( aButtonAct == ERemConCoreApiButtonRelease )
+                    {
+                    TRAP_IGNORE( iObserver->RewindL( EFalse ));
+                    }
+                else {}
+                break;
+                }
+            case ERemConCoreApiForward:
+                {
+                if( aButtonAct == ERemConCoreApiButtonClick )
+                    {
+                    TRAP_IGNORE( iObserver->ForwardL( ETrue ); iObserver->ForwardL( EFalse ));
+                    }
+                break;
+                }
+            case ERemConCoreApiFastForward:
+                {
+                if ( aButtonAct == ERemConCoreApiButtonPress )
+                    {
+                    LOG( "ERemConCoreApiFastForward" );
+                    TRAP_IGNORE( iObserver->FastForwardL( ETrue ));
+                    }
+                else if ( aButtonAct == ERemConCoreApiButtonRelease )
+                    {
+                    TRAP_IGNORE( iObserver->FastForwardL( EFalse ));
+                    }
+                else {}
+                break;
+                }
+            case ERemConCoreApiPlay:
+            case ERemConCoreApiPause:
+            case ERemConCoreApiPausePlayFunction:
+                {
+                if ( aButtonAct == ERemConCoreApiButtonClick )
+                    {
+                    TRAP_IGNORE( iObserver->PausePlayL( ETrue ); iObserver->PausePlayL( EFalse ));
+                    }
+                break;
+                }
+            default:
+                {
+                break;
+                }
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRemConTargetImp::MrccatoPlay( TRemConCoreApiPlaybackSpeed /*aSpeed*/,
+                                      TRemConCoreApiButtonAction aButtonAct )
+    {
+    LOG( "CRadioRemConTargetImp::MrccatoPlay" );
+    if ( iObserver )
+        {
+        if ( aButtonAct == ERemConCoreApiButtonClick )
+            {
+            TRAP_IGNORE( iObserver->PlayL( ETrue ); iObserver->PlayL( EFalse ))
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRemConTargetImp::MrccatoTuneFunction( TBool /*aTwoPart*/,
+                                              TUint /*aMajorChannel*/,
+                                              TUint /*aMinorChannel*/,
+                                              TRemConCoreApiButtonAction /*aButtonAct*/)
+    {
+    LOG( "CRadioRemConTargetImp::MrccatoTuneFunction ( currently unsupported in Visual Radio )" );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRemConTargetImp::MrccatoSelectDiskFunction( TUint /*aDisk*/,
+                                                    TRemConCoreApiButtonAction /*aButtonAct*/)
+    {
+    LOG( "CRadioRemConTargetImp::MrccatoSelectDiskFunction ( currently unsupported in Visual Radio )" );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRemConTargetImp::MrccatoSelectAvInputFunction( TUint8 /*aAvInputSignalNumber*/,
+                                                       TRemConCoreApiButtonAction /*aButtonAct*/)
+    {
+    LOG( "CRadioRemConTargetImp::MrccatoSelectAvInputFunction ( currently unsupported in Visual Radio )" );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRemConTargetImp::MrccatoSelectAudioInputFunction( TUint8 /*aAudioInputSignalNumber*/,
+                                                          TRemConCoreApiButtonAction /*aButtonAct*/)
+    {
+    LOG( "CRadioRemConTargetImp::MrccatoSelectAudioInputFunction ( currently unsupported in Visual Radio )" );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TInt CRadioRemConTargetImp::RepeatTimerCallback( TAny* aPtr )
+    {
+    LOG( "CRadioRemConTargetImp::RepeatTimerCallback" );
+
+    CRadioRemConTargetImp* self = reinterpret_cast<CRadioRemConTargetImp*>( aPtr );
+
+    if ( self )
+        {
+        if ( self->iObserver )
+            {
+            switch ( self->iRepeatId )
+                {
+                case ERemConCoreApiVolumeUp:
+                    {
+                    TRAP_IGNORE( self->iObserver->VolumeUpL( ETrue ); self->iObserver->VolumeUpL( EFalse ))
+                    break;
+                    }
+                case ERemConCoreApiVolumeDown:
+                    {
+                    TRAP_IGNORE( self->iObserver->VolumeDownL( ETrue ); self->iObserver->VolumeDownL( EFalse ))
+                    break;
+                    }
+                default:
+                    {
+                    break;
+                    }
+                }
+            }
+        }
+
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRemConTargetImp::AnswerCall()
+    {
+    LOG( "CRadioRemConTargetImp::AnswerCall() ( currently unsupported in Visual Radio )" );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRemConTargetImp::AnswerEndCall()
+    {
+    LOG( "CRadioRemConTargetImp::AnswerEndCall() " );
+    if ( iObserver )
+        {
+        TRAP_IGNORE( iObserver->AnswerEndCallL())
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRemConTargetImp::DialCall( const TDesC8& /*aTelNumber*/ )
+    {
+    LOG( "CRadioRemConTargetImp::DialCall ( currently unsupported in Visual Radio )" );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRemConTargetImp::EndCall()
+    {
+    LOG( "CRadioRemConTargetImp::EndCall() ( currently unsupported in Visual Radio )" );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRemConTargetImp::GenerateDTMF( const TChar /*aChar*/ )
+    {
+    LOG( "CRadioRemConTargetImp::GenerateDTMF ( currently unsupported in Visual Radio )" );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRemConTargetImp::LastNumberRedial()
+    {
+    LOG( "CRadioRemConTargetImp::LastNumberRedial ( currently unsupported in Visual Radio )" );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRemConTargetImp::MultipartyCalling( const TDesC8& /*aData*/ )
+    {
+    LOG( "CRadioRemConTargetImp::MultipartyCalling ( currently unsupported in Visual Radio )" );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRemConTargetImp::SpeedDial( const TInt /*aIndex*/ )
+    {
+    LOG( "CRadioRemConTargetImp::SpeedDial ( currently unsupported in Visual Radio )" );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRemConTargetImp::VoiceDial( const TBool /*aActivate*/ )
+    {
+    LOG( "CRadioRemConTargetImp::VoiceDial ( currently unsupported in Visual Radio )" );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/src/cradiorepositoryentitybase.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "cradiorepositoryentitybase.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioRepositoryEntityBase::CRadioRepositoryEntityBase( const TUid& aUid,
+                                                        TUint32 aKey,
+                                                        MRadioRepositoryEntityObserver& aObserver,
+                                                        CActive::TPriority aPriority )
+    : CActive( aPriority ), iObserver( aObserver ), iUid( aUid ), iKey( aKey )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioRepositoryEntityBase::~CRadioRepositoryEntityBase()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the UID of this entity.
+// ---------------------------------------------------------------------------
+//
+const TUid& CRadioRepositoryEntityBase::Uid() const
+    {
+    return iUid;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the key of this entity.
+// ---------------------------------------------------------------------------
+//
+TUint32 CRadioRepositoryEntityBase::Key() const
+    {
+    return iKey;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/src/cradiorepositorymanager.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,112 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "cradiorepositorymanager.h"
+#include "cradiorepositorymanagerimp.h"
+#include "radioengineutils.h"
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CRadioRepositoryManager* CRadioRepositoryManager::NewL( TInt aGranularity )
+    {
+    return CRadioRepositoryManagerImp::NewL( aGranularity );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CRadioRepositoryManager::~CRadioRepositoryManager()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the value of a repository key.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CRadioRepositoryManager::SetRepositoryValueL( const TUid& aUid, TUint32 aKey, TInt aValue )
+    {
+    CRadioRepositoryManagerImp::SetRepositoryValueL( aUid, aKey, aValue );
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the value of a repository key.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CRadioRepositoryManager::SetRepositoryValueL( const TUid& aUid, TUint32 aKey, const TReal& aValue )
+    {
+    CRadioRepositoryManagerImp::SetRepositoryValueL( aUid, aKey, aValue );
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the value of a repository key.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CRadioRepositoryManager::SetRepositoryValueL( const TUid& aUid, TUint32 aKey, const TDesC8& aValue )
+    {
+    CRadioRepositoryManagerImp::SetRepositoryValueL( aUid, aKey, aValue );
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the value of a repository key.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CRadioRepositoryManager::SetRepositoryValueL( const TUid& aUid, TUint32 aKey, const TDesC16& aValue )
+    {
+    CRadioRepositoryManagerImp::SetRepositoryValueL( aUid, aKey, aValue );
+    }
+
+// ---------------------------------------------------------------------------
+// Gets the value of a repository key.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CRadioRepositoryManager::GetRepositoryValueL( const TUid& aUid, TUint32 aKey, TInt& aValue )
+    {
+    CRadioRepositoryManagerImp::GetRepositoryValueL( aUid, aKey, aValue );
+    }
+
+// ---------------------------------------------------------------------------
+// Gets the value of a repository key.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CRadioRepositoryManager::GetRepositoryValueL( const TUid& aUid, TUint32 aKey, TReal& aValue )
+    {
+    CRadioRepositoryManagerImp::GetRepositoryValueL( aUid, aKey, aValue );
+    }
+
+// ---------------------------------------------------------------------------
+// Gets the value of a repository key.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CRadioRepositoryManager::GetRepositoryValueL( const TUid& aUid, TUint32 aKey, TDes8& aValue )
+    {
+    CRadioRepositoryManagerImp::GetRepositoryValueL( aUid, aKey, aValue );
+    }
+
+// ---------------------------------------------------------------------------
+// Gets the value of a repository key.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CRadioRepositoryManager::GetRepositoryValueL( const TUid& aUid, TUint32 aKey, TDes16& aValue )
+    {
+    CRadioRepositoryManagerImp::GetRepositoryValueL( aUid, aKey, aValue );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/src/cradiorepositorymanagerimp.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,454 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "cradiorepositoryentity.h"
+#include "cradiorepositorymanager.h"
+#include "cradiorepositorymanagerimp.h"
+#include "radioengineutils.h"
+
+const TInt KVRRepositoryObserverArrayGranularity = 2;
+
+// ======== LOCAL FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Panics the application.
+// ---------------------------------------------------------------------------
+//
+void Panic( TInt aReason )
+    {
+    _LIT( category, "CRadioRepositoryManagerImp" );
+    User::Panic( category, aReason );
+    }
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioRepositoryManagerImp* CRadioRepositoryManagerImp::NewL( TInt aGranularity )
+    {
+    CRadioRepositoryManagerImp* self = new ( ELeave ) CRadioRepositoryManagerImp( aGranularity );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioRepositoryManagerImp::ConstructL()
+    {
+    RadioEngineUtils::InitializeL();
+    CheckRepositoryKeysL();
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioRepositoryManagerImp::CRadioRepositoryManagerImp( TInt aGranularity )
+    : iObservers( KVRRepositoryObserverArrayGranularity )
+    , iEntities( aGranularity )
+    , iEnableSave( ETrue )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioRepositoryManagerImp::~CRadioRepositoryManagerImp()
+    {
+    iObservers.Close();
+    iEntities.ResetAndDestroy();
+    RadioEngineUtils::Release();
+    }
+
+// ---------------------------------------------------------------------------
+// Adds observer
+// ---------------------------------------------------------------------------
+//
+void CRadioRepositoryManagerImp::AddObserverL( MRadioRepositoryEntityObserver* aObserver )
+    {
+    iObservers.AppendL( aObserver );
+    }
+
+// ---------------------------------------------------------------------------
+// Removes observer
+// ---------------------------------------------------------------------------
+//
+ void CRadioRepositoryManagerImp::RemoveObserver( MRadioRepositoryEntityObserver* aObserver )
+    {
+    TInt objectIndex = iObservers.Find( aObserver );
+
+    if ( objectIndex != KErrNotFound )
+        {
+        iObservers.Remove( objectIndex );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Enables or disables the saving of entities.
+// ---------------------------------------------------------------------------
+//
+void CRadioRepositoryManagerImp::EnableSave( TBool aEnable )
+    {
+    iEnableSave = aEnable;
+    }
+
+// ---------------------------------------------------------------------------
+// Adds an entity.
+// ---------------------------------------------------------------------------
+//
+void CRadioRepositoryManagerImp::AddEntityL( const TUid& aUid, TUint32 aKey, TRadioEntityType aType )
+    {
+    CRadioRepositoryEntityBase* entity = NULL;
+
+    switch ( aType )
+        {
+        case ERadioEntityInt:
+            entity = CRadioRepositoryEntity<TInt>::NewL( aUid, aKey, *this );
+            break;
+        case ERadioEntityReal:
+            entity = CRadioRepositoryEntity<TReal>::NewL( aUid, aKey, *this );
+            break;
+        case ERadioEntityDes8:
+            entity = CRadioRepositoryEntity<TRadioEntityBuf8>::NewL( aUid, aKey, *this );
+            break;
+        case ERadioEntityDes16:
+            entity = CRadioRepositoryEntity<TRadioEntityBuf16>::NewL( aUid, aKey, *this );
+            break;
+        default:
+            User::Leave( KErrNotSupported );
+            break;
+        }
+
+    CleanupStack::PushL( entity );
+    iEntities.AppendL( entity );
+    CleanupStack::Pop( entity );
+    }
+
+// ---------------------------------------------------------------------------
+// Removes an entity.
+// ---------------------------------------------------------------------------
+//
+void CRadioRepositoryManagerImp::RemoveEntity( const TUid& aUid, TUint32 aKey )
+    {
+    TInt idx = EntityIndex( aUid, aKey );
+
+    if ( idx >= 0 )
+        {
+        CRadioRepositoryEntityBase* entity = iEntities[idx];
+        iEntities.Remove( idx );
+        iEntities.GranularCompress();
+        delete entity;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Sets an entity's value.
+// ---------------------------------------------------------------------------
+//
+TInt CRadioRepositoryManagerImp::SetEntityValue( const TUid& aUid, TUint32 aKey, TInt aValue )
+    {
+    return DoSetEntityValue<TInt>( aUid, aKey, aValue );
+    }
+
+// ---------------------------------------------------------------------------
+// Sets an entity's value.
+// ---------------------------------------------------------------------------
+//
+TInt CRadioRepositoryManagerImp::SetEntityValue( const TUid& aUid, TUint32 aKey, const TReal& aValue )
+    {
+    return DoSetEntityValue<TReal>( aUid, aKey, aValue );
+    }
+
+// ---------------------------------------------------------------------------
+// Sets an entity's value.
+// ---------------------------------------------------------------------------
+//
+TInt CRadioRepositoryManagerImp::SetEntityValue( const TUid& aUid, TUint32 aKey, const TDesC8& aValue )
+    {
+    return DoSetEntityValue<TRadioEntityBuf8>( aUid, aKey, aValue );
+    }
+
+// ---------------------------------------------------------------------------
+// Sets an entity's value.
+// ---------------------------------------------------------------------------
+//
+TInt CRadioRepositoryManagerImp::SetEntityValue( const TUid& aUid, TUint32 aKey, const TDesC16& aValue )
+    {
+    return DoSetEntityValue<TRadioEntityBuf16>( aUid, aKey, aValue );
+    }
+
+// ---------------------------------------------------------------------------
+// Returns an entity's value.
+// ---------------------------------------------------------------------------
+//
+TInt CRadioRepositoryManagerImp::EntityValueInt( const TUid& aUid, TUint32 aKey ) const
+    {
+    return DoEntityValue<TInt>( aUid, aKey );
+    }
+
+// ---------------------------------------------------------------------------
+// Returns an entity's value.
+// ---------------------------------------------------------------------------
+//
+const TReal& CRadioRepositoryManagerImp::EntityValueReal( const TUid& aUid, TUint32 aKey ) const
+    {
+    return DoEntityValue<TReal>( aUid, aKey );
+    }
+
+// ---------------------------------------------------------------------------
+// Returns an entity's value.
+// ---------------------------------------------------------------------------
+//
+const TDesC8& CRadioRepositoryManagerImp::EntityValueDes8( const TUid& aUid, TUint32 aKey ) const
+    {
+    return DoEntityValue<TDesC8>( aUid, aKey );
+    }
+
+// ---------------------------------------------------------------------------
+// Returns an entity's value.
+// ---------------------------------------------------------------------------
+//
+const TDesC16& CRadioRepositoryManagerImp::EntityValueDes16( const TUid& aUid, TUint32 aKey ) const
+    {
+    return DoEntityValue<TDesC16>( aUid, aKey );
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the value of a repository key.
+// ---------------------------------------------------------------------------
+//
+void CRadioRepositoryManagerImp::SetRepositoryValueL( const TUid& aUid, TUint32 aKey, TInt aValue )
+    {
+    DoSetRepositoryValueL( aUid, aKey, aValue );
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the value of a repository key.
+// ---------------------------------------------------------------------------
+//
+void CRadioRepositoryManagerImp::SetRepositoryValueL( const TUid& aUid, TUint32 aKey, const TReal& aValue )
+    {
+    DoSetRepositoryValueL( aUid, aKey, aValue );
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the value of a repository key.
+// ---------------------------------------------------------------------------
+//
+void CRadioRepositoryManagerImp::SetRepositoryValueL( const TUid& aUid, TUint32 aKey, const TDesC8& aValue )
+    {
+    DoSetRepositoryValueL( aUid, aKey, aValue );
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the value of a repository key.
+// ---------------------------------------------------------------------------
+//
+void CRadioRepositoryManagerImp::SetRepositoryValueL( const TUid& aUid, TUint32 aKey, const TDesC16& aValue )
+    {
+    DoSetRepositoryValueL( aUid, aKey, aValue );
+    }
+
+// ---------------------------------------------------------------------------
+// Gets the value of a repository key.
+// ---------------------------------------------------------------------------
+//
+void CRadioRepositoryManagerImp::GetRepositoryValueL( const TUid& aUid, TUint32 aKey, TInt& aValue )
+    {
+    DoGetRepositoryValueL( aUid, aKey, aValue );
+    }
+
+// ---------------------------------------------------------------------------
+// Gets the value of a repository key.
+// ---------------------------------------------------------------------------
+//
+void CRadioRepositoryManagerImp::GetRepositoryValueL( const TUid& aUid, TUint32 aKey, TReal& aValue )
+    {
+    DoGetRepositoryValueL( aUid, aKey, aValue );
+    }
+
+// ---------------------------------------------------------------------------
+// Gets the value of a repository key.
+// ---------------------------------------------------------------------------
+//
+void CRadioRepositoryManagerImp::GetRepositoryValueL( const TUid& aUid, TUint32 aKey, TDes8& aValue )
+    {
+    DoGetRepositoryValueL( aUid, aKey, aValue );
+    }
+
+// ---------------------------------------------------------------------------
+// Gets the value of a repository key.
+// ---------------------------------------------------------------------------
+//
+void CRadioRepositoryManagerImp::GetRepositoryValueL( const TUid& aUid, TUint32 aKey, TDes16& aValue )
+    {
+    DoGetRepositoryValueL( aUid, aKey, aValue );
+    }
+
+// ---------------------------------------------------------------------------
+// Sets an entity's value.
+// ---------------------------------------------------------------------------
+//
+template <typename T>
+TInt CRadioRepositoryManagerImp::DoSetEntityValue( const TUid& aUid, TUint32 aKey, const T& aValue )
+    {
+    TInt idx = EntityIndex( aUid, aKey );
+
+    // If the entity could not be found, panic the application.
+    __ASSERT_ALWAYS( idx >= 0, ::Panic( KErrArgument ) );
+
+    return static_cast<CRadioRepositoryEntity<T>*>( iEntities[idx] )->SetValue( aValue, iEnableSave );
+    }
+
+// ---------------------------------------------------------------------------
+// Returns an entity's value.
+// ---------------------------------------------------------------------------
+//
+template <typename T>
+const T& CRadioRepositoryManagerImp::DoEntityValue( const TUid& aUid, TUint32 aKey ) const
+    {
+    TInt idx = EntityIndex( aUid, aKey );
+
+    // If the entity could not be found, panic the application.
+    __ASSERT_ALWAYS( idx >= 0, ::Panic( KErrArgument ) );
+
+    return static_cast<CRadioRepositoryEntity<T>*>( iEntities[idx] )->Value();
+    }
+
+// ---------------------------------------------------------------------------
+// Sets a key's value in the repository.
+// ---------------------------------------------------------------------------
+//
+template <typename T>
+void CRadioRepositoryManagerImp::DoSetRepositoryValueL( const TUid& aUid, TUint32 aKey, const T& aValue )
+    {
+    CRepository* repository = CRepository::NewLC( aUid );
+    User::LeaveIfError( repository->Set( aKey, aValue ) );
+    CleanupStack::PopAndDestroy( repository );
+    }
+
+// ---------------------------------------------------------------------------
+// Returns a key's value in the repository.
+// ---------------------------------------------------------------------------
+//
+template <typename T>
+void CRadioRepositoryManagerImp::DoGetRepositoryValueL( const TUid& aUid, TUint32 aKey, T& aValue )
+    {
+    CRepository* repository = CRepository::NewLC( aUid );
+    User::LeaveIfError( repository->Get( aKey, aValue ) );
+    CleanupStack::PopAndDestroy( repository );
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the entity's index that matches the supplied arguments.
+// ---------------------------------------------------------------------------
+//
+TInt CRadioRepositoryManagerImp::EntityIndex( const TUid& aUid, TUint32 aKey ) const
+    {
+    TInt idx = KErrNotFound;
+
+    for ( TInt i = 0; i < iEntities.Count(); i++ )
+        {
+        CRadioRepositoryEntityBase* entity = iEntities[i];
+        if ( entity->Uid() == aUid && entity->Key() == aKey )
+            {
+            idx = i;
+            break;
+            }
+        }
+
+    return idx;
+    }
+
+// ---------------------------------------------------------------------------
+// SIS installation does not update central repository, this checks that the new keys are in the repository.
+// ---------------------------------------------------------------------------
+//
+void CRadioRepositoryManagerImp::CheckRepositoryKeysL()
+    {
+    // After adding a new cenrep key to radiointernalcrkeys.h, add it also here with a default value
+    /*
+    CRepository* repository = CRepository::NewLC( KVRCRUid );
+
+    TInt ret = repository->Create( KVRCRNewValue, TInt( 123 ) );
+    if ( ret != KErrAlreadyExists )
+        {
+        User::LeaveIfError( ret );
+        }
+
+    CleanupStack::PopAndDestroy( repository );
+    */
+    }
+
+// ---------------------------------------------------------------------------
+// Forwards the repository value changes
+// ---------------------------------------------------------------------------
+//
+void CRadioRepositoryManagerImp::HandleRepositoryValueChangeL( const TUid& aUid,
+        TUint32 aKey, TInt aValue, TInt aError )
+    {
+    for ( TInt i = 0; i < iObservers.Count(); i++ )
+        {
+        iObservers[i]->HandleRepositoryValueChangeL( aUid, aKey, aValue, aError );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Forwards the repository value changes
+// ---------------------------------------------------------------------------
+//
+void CRadioRepositoryManagerImp::HandleRepositoryValueChangeL( const TUid& aUid,
+        TUint32 aKey, const TReal& aValue, TInt aError )
+    {
+    for ( TInt i = 0; i < iObservers.Count(); i++ )
+        {
+        iObservers[i]->HandleRepositoryValueChangeL( aUid, aKey, aValue, aError );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Forwards the repository value changes
+// ---------------------------------------------------------------------------
+//
+void CRadioRepositoryManagerImp::HandleRepositoryValueChangeL( const TUid& aUid,
+        TUint32 aKey, const TDesC8& aValue, TInt aError )
+    {
+    for ( TInt i = 0; i < iObservers.Count(); i++ )
+        {
+        iObservers[i]->HandleRepositoryValueChangeL( aUid, aKey, aValue, aError );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Forwards the repository value changes
+// ---------------------------------------------------------------------------
+//
+void CRadioRepositoryManagerImp::HandleRepositoryValueChangeL( const TUid& aUid,
+        TUint32 aKey, const TDesC16& aValue, TInt aError )
+    {
+    for ( TInt i = 0; i < iObservers.Count(); i++ )
+        {
+        iObservers[i]->HandleRepositoryValueChangeL( aUid, aKey, aValue, aError );
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/src/cradioroutableaudio.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,92 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// System includes
+#include <AudioOutput.h>
+
+// User includes
+#include "cradioroutableaudio.h"
+#include "cradioaudiorouter.h"
+
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CRadioRoutableAudio::CRadioRoutableAudio( CRadioAudioRouter* aAudioRouter )
+    : iAudioRouter( aAudioRouter )
+    {
+    iAudioRouter->RegisterRoutableAudio( this );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CRadioRoutableAudio::~CRadioRoutableAudio()
+    {
+    iAudioRouter->UnRegisterRoutableAudio( this );
+    delete iAudioOutput;
+    delete iAudioRouter;
+    }
+
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CRadioRoutableAudio::SetAudioOutput( CAudioOutput* aAudioOutput )
+    {
+    delete iAudioOutput;
+    iAudioOutput = aAudioOutput;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CRadioRoutableAudio::DeleteAudioOutput()
+    {
+    delete iAudioOutput;
+    iAudioOutput = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CRadioRoutableAudio::SetAudioRouteL( RadioEngine::TRadioAudioRoute aRoute )
+    {
+    if ( iAudioOutput )
+        {
+        iAudioOutput->SetAudioOutputL( aRoute == RadioEngine::ERadioSpeaker ? CAudioOutput::EPublic
+                                                                            : CAudioOutput::EPrivate );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CRadioRoutableAudio::AudioRoutingSupported() const
+    {
+#ifdef __WINS__
+    return ETrue;
+#else
+    return iAudioOutput ? ETrue : EFalse;
+#endif
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/src/cradiosystemeventcollector.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// User includes
+#include "cradiosystemeventcollector.h"
+#include "cradiosystemeventcollectorimp.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CRadioSystemEventCollector* CRadioSystemEventCollector::NewL()
+    {
+    return CRadioSystemEventCollectorImp::NewL();
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CRadioSystemEventCollector::~CRadioSystemEventCollector()
+    {
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/src/cradiosystemeventcollectorimp.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,266 @@
+/*
+* 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:
+*
+*/
+
+// System includes
+#include <e32cmn.h>
+#include <UiklafInternalCRKeys.h>
+
+// User includes
+#include "cradioaccessoryobserver.h"
+#include "cradiorepositorymanager.h"
+#include "cradiosystemeventcollectorimp.h"
+#include "cradiosystemeventdetector.h"
+#include "radioengineutils.h"
+#include "cradioenginelogger.h"
+
+const TInt KVRObserverArrayGranularity( 2 );
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioSystemEventCollectorImp::CRadioSystemEventCollectorImp() :
+    iSystemEventObservers( KVRObserverArrayGranularity )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioSystemEventCollectorImp::ConstructL()
+    {
+    RadioEngineUtils::InitializeL();
+    iSystemEventDetector = CRadioSystemEventDetector::NewL( *this );
+
+    iHeadsetObserver = CRadioAccessoryObserver::NewL();
+    iHeadsetObserver->SetObserver( this );
+
+    TInt criticalLevel;
+    CRadioRepositoryManager::GetRepositoryValueL( KCRUidUiklaf,
+        KUikOODDiskCriticalThreshold, criticalLevel );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioSystemEventCollectorImp* CRadioSystemEventCollectorImp::NewL()
+    {
+    CRadioSystemEventCollectorImp* self = new( ELeave ) CRadioSystemEventCollectorImp;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioSystemEventCollectorImp::~CRadioSystemEventCollectorImp()
+    {
+    delete iSystemEventDetector;
+    delete iHeadsetObserver;
+
+    iSystemEventObservers.Close();
+    RadioEngineUtils::Release();
+    }
+
+// ---------------------------------------------------------------------------
+// Adds a system event observer
+// ---------------------------------------------------------------------------
+//
+void CRadioSystemEventCollectorImp::AddObserverL( MRadioSystemEventObserver* aHeadsetObserver )
+    {
+    iSystemEventObservers.AppendL( aHeadsetObserver );
+    }
+
+// ---------------------------------------------------------------------------
+// Removes a system event observer
+// ---------------------------------------------------------------------------
+//
+ void CRadioSystemEventCollectorImp::RemoveObserver( MRadioSystemEventObserver* aSystemObserver )
+    {
+    TInt objectIndex = iSystemEventObservers.Find( aSystemObserver );
+
+    if ( objectIndex != KErrNotFound )
+        {
+        iSystemEventObservers.Remove( objectIndex );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Getter for mobile network state
+// ---------------------------------------------------------------------------
+//
+TBool CRadioSystemEventCollectorImp::IsMobileNetworkCoverage() const
+    {
+    return iSystemEventDetector->IsMobileNetworkCoverage();
+    }
+
+// ---------------------------------------------------------------------------
+// Getter for network state
+// ---------------------------------------------------------------------------
+//
+TBool CRadioSystemEventCollectorImp::IsNetworkCoverage() const
+    {
+    return iSystemEventDetector->IsNetworkCoverage();
+    }
+
+// ---------------------------------------------------------------------------
+// Getter for call state
+// ---------------------------------------------------------------------------
+//
+TBool CRadioSystemEventCollectorImp::IsCallActive() const
+    {
+    return iSystemEventDetector->IsCallActive();
+    }
+
+// ---------------------------------------------------------------------------
+// Getter for audio resource state
+// ---------------------------------------------------------------------------
+//
+TBool CRadioSystemEventCollectorImp::IsAudioResourcesAvailable() const
+    {
+    return iSystemEventDetector->IsAudioResourcesAvailable();
+    }
+
+// ---------------------------------------------------------------------------
+// Getter for headset connection status
+// ---------------------------------------------------------------------------
+TBool CRadioSystemEventCollectorImp::IsHeadsetConnectedL() const
+    {
+    return iHeadsetObserver->IsHeadsetConnectedL();
+    }
+
+// ---------------------------------------------------------------------------
+// Getter Vocie UI state
+// ---------------------------------------------------------------------------
+TBool CRadioSystemEventCollectorImp::IsVoiceUiActive() const
+    {
+    return iSystemEventDetector->IsVoiceUiActive();
+    }
+
+// ---------------------------------------------------------------------------
+// Notifies the observers of system event
+// ---------------------------------------------------------------------------
+//
+void CRadioSystemEventCollectorImp::NotifyObserversL( TRadioSystemEventType aEvent )
+    {
+    for ( TInt i = 0; i < iSystemEventObservers.Count(); ++i )
+        {
+        iSystemEventObservers[i]->HandleSystemEventL( aEvent );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioSystemEventDetectorObserver.
+// ---------------------------------------------------------------------------
+//
+void CRadioSystemEventCollectorImp::NetworkUpCallbackL()
+    {
+    NotifyObserversL( ERadioNetworkCoverageUp );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioSystemEventDetectorObserver.
+// ---------------------------------------------------------------------------
+//
+void CRadioSystemEventCollectorImp::NetworkDownCallbackL()
+    {
+    NotifyObserversL( ERadioNetworkCoverageDown );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioSystemEventDetectorObserver.
+// ---------------------------------------------------------------------------
+//
+void CRadioSystemEventCollectorImp::CallActivatedCallbackL()
+    {
+    NotifyObserversL( ERadioCallActivated );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioSystemEventDetectorObserver.
+// ---------------------------------------------------------------------------
+//
+void CRadioSystemEventCollectorImp::CallDeactivatedCallbackL()
+    {
+    NotifyObserversL( ERadioCallDeactivated );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioSystemEventDetectorObserver.
+// ---------------------------------------------------------------------------
+//
+void CRadioSystemEventCollectorImp::AudioResourcesAvailableL()
+    {
+    NotifyObserversL( ERadioAudioResourcesAvailable );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioSystemEventDetectorObserver.
+// ---------------------------------------------------------------------------
+//
+void CRadioSystemEventCollectorImp::AudioAutoResumeForbiddenL()
+    {
+    NotifyObserversL( ERadioAudioAutoResumeForbidden );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioSystemEventDetectorObserver.
+// ---------------------------------------------------------------------------
+//
+void CRadioSystemEventCollectorImp::ErrorCallbackL( TInt DEBUGVAR( aError ) )
+    {
+    LOG_FORMAT( "CRadioSystemEventCollectorImp::ErrorCallbackL - %d", aError );
+    // P&S get fail not considered as a critical issue.
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioHeadsetEventObserver.
+// ---------------------------------------------------------------------------
+//
+void CRadioSystemEventCollectorImp::HeadsetConnectedCallbackL()
+    {
+    NotifyObserversL( ERadioHeadsetConnected );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioHeadsetEventObserver.
+// ---------------------------------------------------------------------------
+//
+void CRadioSystemEventCollectorImp::HeadsetDisconnectedCallbackL()
+    {
+    NotifyObserversL( ERadioHeadsetDisconnected );
+    }
+
+// ---------------------------------------------------------------------------
+// From class MRadioAudioRoutingObserver.
+// ---------------------------------------------------------------------------
+//
+void CRadioSystemEventCollectorImp::AudioRouteChangedL( RadioEngine::TRadioAudioRoute aRoute )
+    {
+    TRadioSystemEventType ev = ERadioAudioRouteHeadset;
+    if ( aRoute != RadioEngine::ERadioHeadset )
+        {
+        ev = ERadioAudioRouteSpeaker;
+        }
+
+    NotifyObserversL( ev );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/src/cradiosystemeventdetector.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,442 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <e32def.h> // Define before audiopolicy defs
+#include <e32std.h> // Define before audiopolicy defs
+#include <eikdef.h>
+
+#ifndef __WINS__
+
+#include <audiopolicypubsubdata.h>
+#include <audiosw_pubsubkeys.h>
+
+#endif //__WINS__
+
+#include <ctsydomainpskeys.h>
+#include <publicruntimeids.hrh>
+#include <sacls.h>
+
+#ifdef COMPILE_IN_IVALO
+#   include <voiceuidomainpskeys.h>
+#endif //COMPILE_IN_IVALO
+#include <featmgr.h>
+
+// User includes
+#include "cradioenginelogger.h"
+#include "cradiosystemeventdetector.h"
+#include "mradiosystemeventdetectorobserver.h"
+
+/** Granularity for audio category arrays. */
+const TInt KVRAudioCategoryArrayGranularity = 3;
+
+// This has to be the last include. 
+#ifdef STUB_CONSTELLATION
+#   include "RadioStubManager.h"
+#   define KUidSystemCategory KStub_KUidSystemCategory
+#   define KPSUidCtsyCallInformation KStub_KPSUidCtsyCallInformation
+#   define KPSUidVoiceUiAccMonitor KStub_KPSUidVoiceUiAccMonitor
+#   define KPSUidMMFAudioServer KStub_KPSUidMMFAudioServer
+#endif //STUB_CONSTELLATION
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioSystemEventDetector::CRadioSystemEventDetector( MRadioSystemEventDetectorObserver&  aObserver )
+    : iObserver( aObserver )
+    , iIsMobileNetworkCoverage( EFalse )
+    , iIsWlanCoverage( EFalse )
+    , iIsCallActive( EFalse )
+    , iIsAudioResourcesAvailable( ETrue )
+    , iIsVoiceUiActive( EFalse )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioSystemEventDetector::ConstructL()
+    {
+//    FeatureManager::InitializeLibL();
+//    TBool wlanSupported = FeatureManager::FeatureSupported( KFeatureIdProtocolWlan );
+//    FeatureManager::UnInitializeLib();
+    TBool wlanSupported = EFalse; //TODO: Check if we have any need for this
+
+    iNetworkStatusObserver = CRadioPropertyObserver::NewL( *this,
+                                                           KUidSystemCategory,
+                                                           KUidNetworkStatusValue,
+                                                           CRadioPropertyObserver::ERadioPropertyInt );
+    iNetworkStatusObserver->ActivateL();
+
+    iIsMobileNetworkCoverage = iNetworkStatusObserver->ValueInt() == ESANetworkAvailable;
+
+    // On S60 platform, there is no guaranteed way of seeing whether WLAN is explicitly turned off
+    // in the settings, or whether the network is available. For now, we only check the existence of
+    // the WLAN support in the feature manager. We might also want to check whether WLAN access points
+    // have been configured.
+    iIsWlanCoverage = wlanSupported;
+
+    // Initialize call state observer.
+    iCallStatusObserver = CRadioPropertyObserver::NewL( *this,
+                                                        KPSUidCtsyCallInformation,
+                                                        KCTsyCallState,
+                                                        CRadioPropertyObserver::ERadioPropertyInt );
+    iCallStatusObserver->ActivateL();
+    iIsCallActive = iCallStatusObserver->ValueInt() != EPSCTsyCallStateNone;
+
+#ifdef COMPILE_IN_IVALO
+    // Initialize voice ui observer.
+    iVoiceUiObserver = CRadioPropertyObserver::NewL( *this,
+                                                     KPSUidVoiceUiAccMonitor,
+                                                     KVoiceUiOpenKey,
+                                                     CRadioPropertyObserver::ERadioPropertyInt );
+    iVoiceUiObserver->ActivateL();
+#endif //COMPILE_IN_IVALO
+
+#ifndef __WINS__
+    // Define audio types for not resuming.
+    iNoAutoResumeAudioCategories = RArray<TInt>( KVRAudioCategoryArrayGranularity );
+    iNoAutoResumeAudioCategories.AppendL( ECatMediaPlayer );
+    iNoAutoResumeAudioCategories.AppendL( ECatMobileTv );
+    iNoAutoResumeAudioCategories.AppendL( ECatUnknownPlayer );
+    iNoAutoResumeAudioCategories.Compress();
+    // Start listening audio client events.
+    iAudioPolicyObserver = CRadioPropertyObserver::NewL( *this, KPSUidMMFAudioServer, KAudioPolicyAudioClients, CRadioPropertyObserver::ERadioPropertyByteArray );
+    iAudioPolicyObserver->ActivateL();
+#endif
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioSystemEventDetector::~CRadioSystemEventDetector()
+    {
+    FeatureManager::UnInitializeLib();
+    delete iCallStatusObserver;
+    delete iNetworkStatusObserver;
+    delete iVoiceUiObserver;
+    delete iAudioPolicyObserver;
+
+    iNoAutoResumeAudioCategories.Close();
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CRadioSystemEventDetector* CRadioSystemEventDetector::NewL( MRadioSystemEventDetectorObserver&  aObserver )
+    {
+    CRadioSystemEventDetector* self = new ( ELeave ) CRadioSystemEventDetector( aObserver );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Handling of the int property changes is done here.
+// Observer components are getting notifications in correspondence with what
+// has changed
+// ---------------------------------------------------------------------------
+//
+void CRadioSystemEventDetector::HandlePropertyChangeL( const TUid& aCategory,
+                                                       const TUint aKey,
+                                                       const TInt aValue )
+    {
+    //TODO: Refactor
+    if ( aCategory == KUidSystemCategory && aKey == KUidNetworkStatusValue )
+        {
+        switch ( aValue )
+            {
+            case ESANetworkAvailable:
+                {
+                SetNetworkCoverageL( ETrue, iIsWlanCoverage );
+                break;
+                }
+            case ESANetworkUnAvailable:
+                {
+                SetNetworkCoverageL( EFalse, iIsWlanCoverage );
+                break;
+                }
+            default:
+                {
+                break;
+                }
+            }
+        }
+    else if ( aCategory == KPSUidCtsyCallInformation && aKey == KCTsyCallState )
+        {
+        if ( (!iIsCallActive ) && ( aValue > EPSCTsyCallStateNone ))
+            {
+            iIsCallActive = ETrue;
+            iObserver.CallActivatedCallbackL();
+            }
+        else if ( ( iIsCallActive ) && ( aValue <= EPSCTsyCallStateNone ))
+            {
+            iIsCallActive = EFalse;
+            iObserver.CallDeactivatedCallbackL();
+            }
+        else
+            {
+            // No change
+            }
+        }
+#ifdef COMPILE_IN_IVALO
+    else if ( aCategory == KPSUidVoiceUiAccMonitor && aKey == KVoiceUiOpenKey )
+        {
+        switch ( aValue )
+            {
+            case KVoiceUiIsClose:
+                {
+                if ( iIsVoiceUiActive )
+                    {
+                    iIsVoiceUiActive = EFalse;
+                    LOG( "Voice UI not active." );
+                    if ( iIsAudioResourcesAvailable )
+                        {
+                        LOG( "Audio resources available. Change informed." );
+                        iObserver.AudioResourcesAvailableL();
+                        }
+                    }
+                break;
+                }
+            case KVoiceUiIsOpen:
+                {
+                if ( !iIsVoiceUiActive )
+                    {
+                    iIsVoiceUiActive = ETrue;
+                    LOG( "Voice UI active." );
+                    }
+                break;
+                }
+            default:
+                {
+                break;
+                }
+            }
+        }
+#endif //COMPILE_IN_IVALO
+    else // NOP
+        {
+        }
+    }
+
+#ifndef __WINS__
+// ---------------------------------------------------------------------------
+// Handling of the byte array property changes is done here.
+// Observer components are getting notifications in correspondence with what
+// has changed
+// ---------------------------------------------------------------------------
+//
+void CRadioSystemEventDetector::HandlePropertyChangeL( const TUid& aCategory,
+                                                       const TUint aKey,
+                                                       const TDesC8& aValue )
+    {
+#if 0
+    LOG_METHOD_AUTO;
+    LOG_FORMAT( "Category: %d, Key: %d", aCategory, aKey );
+    if ( aCategory == KPSUidMMFAudioServer )
+        {
+        if ( aKey == KAudioPolicyAudioClients )
+            {
+            TBool atLeastOneAutoResumeAudioPlaying( EFalse );
+            TBool atLeastOneNoAutoResumeAudioPlaying( EFalse );
+            TBool radioPlaying( EFalse );
+            TAudioClientList audioClients;
+            audioClients.Copy( aValue );
+            // Check all playing audios!
+            for ( TInt i = 0; i < audioClients().iNumOfProcesses ; i++ )
+                {
+                TInt cat = audioClients().iClientCategoryList[i];
+                LOG_FORMAT( "Check audio cat %x", cat );
+                if ( cat == ECatFmRadio )
+                    {
+                    radioPlaying = ETrue;
+                    }
+                else if ( iNoAutoResumeAudioCategories.Find( cat ) != KErrNotFound )
+                    {
+                    atLeastOneNoAutoResumeAudioPlaying = ETrue;
+                    }
+                else
+                    {
+                    atLeastOneAutoResumeAudioPlaying = ETrue;
+                    }
+                }
+
+            if ( !radioPlaying )
+                {
+                // Decide audio resource availability from audio category info.
+                if ( atLeastOneNoAutoResumeAudioPlaying )
+                    {
+                    LOG( "Audio resources not available. Change informed." );
+                    iIsAudioResourcesAvailable = EFalse;
+                    iObserver.AudioAutoResumeForbiddenL();
+                    }
+                else if ( !atLeastOneAutoResumeAudioPlaying )
+                    {
+                    if ( !iIsVoiceUiActive )
+                        {
+                        LOG( "Audio resources available. Change informed." );
+                        iIsAudioResourcesAvailable = ETrue;
+                        iObserver.AudioResourcesAvailableL();
+                        }
+                    else
+                        {
+                        LOG( "Audio resources available. Change not informed." );
+                        iIsAudioResourcesAvailable = ETrue;
+                        }
+                    }
+                else
+                    {
+                    LOG( "Audio resources not available. Change not informed." );
+                    iIsAudioResourcesAvailable = EFalse;
+                    }
+                }
+            else // audio resources are considered to be available when radio is playing
+                {
+                iIsAudioResourcesAvailable = ETrue;
+                }
+            }
+        }
+#endif
+    }
+
+#else //__WINS__
+// ---------------------------------------------------------------------------
+// Dummy version for WINS in order to avoid compiler warnings.
+// The real implementation of function is above.
+// ---------------------------------------------------------------------------
+//
+void CRadioSystemEventDetector::HandlePropertyChangeL( const TUid& /*aCategory*/,
+                                                       const TUint /*aKey*/,
+                                                        const TDesC8& /*aValue*/)
+    {
+    }
+#endif
+
+// ---------------------------------------------------------------------------
+// Handling of the text property changes is done here.
+// Observer components are getting notifications in correspondence with what
+// has changed
+// ---------------------------------------------------------------------------
+//
+void CRadioSystemEventDetector::HandlePropertyChangeL( const TUid& /*aCategory*/,
+                                                       const TUint /*aKey*/,
+                                                       const TDesC& /*aValue*/)
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// This is a callback function which is called when a P&S components returns
+// an error
+// ---------------------------------------------------------------------------
+//
+void CRadioSystemEventDetector::HandlePropertyChangeErrorL( const TUid& aCategory,
+                                                            const TUint aKey,
+                                                            TInt aError )
+    {
+#ifdef COMPILE_IN_IVALO
+    if ( aCategory == KPSUidVoiceUiAccMonitor && aKey == KVoiceUiOpenKey && aError == KErrNotFound )
+        {
+        HandlePropertyChangeL( KPSUidVoiceUiAccMonitor, KVoiceUiOpenKey, KVoiceUiIsClose );
+        }
+    else
+        {
+        iObserver.ErrorCallbackL( aError );
+        }
+#else
+    (void)aCategory;
+    (void)aKey;
+    (void)aError;
+#endif //COMPILE_IN_IVALO
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioSystemEventDetector::IsMobileNetworkCoverage() const
+    {
+    return iIsMobileNetworkCoverage;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioSystemEventDetector::IsNetworkCoverage() const
+    {
+    return iIsWlanCoverage || iIsMobileNetworkCoverage;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioSystemEventDetector::IsCallActive() const
+    {
+    return iIsCallActive;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioSystemEventDetector::IsAudioResourcesAvailable() const
+    {
+    return iIsAudioResourcesAvailable;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CRadioSystemEventDetector::IsVoiceUiActive() const
+    {
+    return iIsVoiceUiActive;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CRadioSystemEventDetector::SetNetworkCoverageL( const TBool aIsMobileNetworkCoverage,
+                                                     const TBool aIsWlanCoverage )
+    {
+    LOG_FORMAT( "CRadioSystemEventDetector::SetNetworkCoverageL ( mobile = %d wlan = %d )", aIsMobileNetworkCoverage, aIsWlanCoverage );
+
+    TBool wasCoverage = IsNetworkCoverage();
+    iIsMobileNetworkCoverage = aIsMobileNetworkCoverage;
+    iIsWlanCoverage = aIsWlanCoverage;
+    TBool isCoverage = IsNetworkCoverage();
+
+    if ( isCoverage != wasCoverage )
+        {
+        if ( isCoverage )
+            {
+            iObserver.NetworkUpCallbackL();
+            }
+        else
+            {
+            iObserver.NetworkDownCallbackL();
+            }
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/radioengine/utils/src/radioengineutils.cpp	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,123 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// System includes
+#include <StringLoader.h>
+#include <utf.h>
+
+// User includes
+#include "radioengineutils.h"
+#include "cradioenginetls.h"
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void RadioEngineUtils::InitializeL( CCoeEnv* aCoeEnv )
+    {
+    CRadioEngineTls::InitializeL( aCoeEnv );
+    CRadioEngineTls::Instance().AddRef();
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void RadioEngineUtils::Release()
+    {
+    CRadioEngineTls::Instance().Release();
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C MRadioEngineLogger* RadioEngineUtils::Logger()
+    {
+    return CRadioEngineTls::Instance().Logger();
+    }
+
+// ---------------------------------------------------------------------------
+// Return the cone environment
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CCoeEnv* RadioEngineUtils::Env()
+    {
+    return CRadioEngineTls::Instance().Env();
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the file server session
+// ---------------------------------------------------------------------------
+//
+EXPORT_C RFs& RadioEngineUtils::FsSession()
+    {
+    return CRadioEngineTls::Instance().FsSession();
+    }
+
+// ---------------------------------------------------------------------------
+// Utility method for frequency formatting.
+// Frequency is assumed to be in kilohertz format.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C HBufC* RadioEngineUtils::ReadFrequencyStringLC( TUint32 aFreq,
+                                                         TInt aDecimalCount,
+                                                         TInt aResourceId )
+    {
+    TBuf<KDefaultRealWidth> freqText;
+    freqText.AppendNum( static_cast<TReal>( aFreq ) / 1000.0f, TRealFormat( KDefaultRealWidth, aDecimalCount ) ); // Converts kilohertz to megahertz.
+
+    // Converts the numbers to the proper display mode.
+
+    HBufC* channelFreq = NULL;
+
+    if ( aResourceId == KErrNotFound ) // No resource string.
+        {
+        channelFreq = freqText.AllocLC();
+        }
+    else
+        {
+        channelFreq = StringLoader::LoadLC( aResourceId, freqText );
+        }
+
+    return channelFreq;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void RadioEngineUtils::FormatFrequencyString( TDes& aDest,
+                                                       TUint32 aFreq,
+                                                       TInt aDecimalCount,
+                                                       TDesC& aFormat )
+    {
+    TBuf<KDefaultRealWidth> freqText;
+    freqText.AppendNum( static_cast<TReal>( aFreq ) / 1000.0f, TRealFormat( KDefaultRealWidth, aDecimalCount ) ); // Converts kilohertz to megahertz.
+
+    // Converts the numbers to the proper display mode.
+
+    if ( aFormat.Length() <= 0 || freqText.Length() > aDest.MaxLength() ) // No format.
+        {
+        aDest.Copy( freqText.Left( aDest.Length() ) );
+        }
+    else
+        {
+        StringLoader::Format( aDest, aFormat, KErrNotFound, freqText );
+        }
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rom/bld.inf	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include<platform_paths.hrh>
+
+PRJ_EXPORTS
+fmradio.iby             CORE_APP_LAYER_IBY_EXPORT_PATH(fmradio.iby)
+fmradio_resources.iby   LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(fmradio_resources.iby)
+
+PRJ_EXTENSIONS
+#ifdef MARM
+    START EXTENSION app-services/buildstubsis
+        OPTION SRCDIR .
+        OPTION SISNAME qtfmradio_stub
+    END
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rom/fmradio.iby	Fri Jun 04 10:21:36 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 file for FMRadio
+*
+*/
+
+
+#ifndef FMRADIO_IBY
+#define FMRADIO_IBY
+
+// Use standard macros
+#include <data_caging_paths_for_iby.hrh>
+
+S60_APP_EXE(qtfmradio)
+data=ZPRIVATE\10003a3f\import\apps\qtfmradio_reg.rsc                private\10003a3f\import\apps\qtfmradio_reg.rsc
+
+file=ABI_DIR\BUILD_DIR\radioenginewrapper.dll                       SHARED_LIB_DIR\radioenginewrapper.dll       PAGED
+file=ABI_DIR\BUILD_DIR\radiopresetstorage.dll                       SHARED_LIB_DIR\radiopresetstorage.dll       PAGED
+file=ABI_DIR\BUILD_DIR\radiouiengine.dll                            SHARED_LIB_DIR\radiouiengine.dll            PAGED
+file=ABI_DIR\BUILD_DIR\radiowidgets.dll                             SHARED_LIB_DIR\radiowidgets.dll             PAGED
+file=ABI_DIR\BUILD_DIR\radiowidgetsplugin.dll                       SHARED_LIB_DIR\radiowidgetsplugin.dll       PAGED
+data=\epoc32\data\z\resource\plugins\radiowidgetsplugin.qtplugin    resource\plugins\radiowidgetsplugin.qtplugin
+
+file=ABI_DIR\BUILD_DIR\radioengine.dll                              SHARED_LIB_DIR\radioengine.dll              PAGED
+file=ABI_DIR\BUILD_DIR\radioengineutils.dll                         SHARED_LIB_DIR\radioengineutils.dll         PAGED
+file=ABI_DIR\BUILD_DIR\radioenginesettings.dll                      SHARED_LIB_DIR\radioenginesettings.dll      PAGED
+
+data=ZPRIVATE\10202be9\101FF976.txt                                 private\10202be9\101FF976.txt
+data=\epoc32\data\z\resource\radioenginesettings.rsc                \resource\radioenginesettings.rsc
+
+data=\epoc32\data\z\system\install\qtfmradio_stub.sis               system\install\qtfmradio_stub.sis
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rom/fmradio_resources.iby	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* Iby file for FMRadio
+*
+*/
+
+
+#ifndef FMRADIO_RESOURCES_IBY
+#define FMRADIO_RESOURCES_IBY
+
+// Use standard macros
+#include <data_caging_paths_for_iby.hrh>
+
+S60_APP_RESOURCE(qtfmradio)
+
+data=DATAZ_\QT_TRANSLATIONS_DIR\fmradio.qm  QT_TRANSLATIONS_DIR\fmradio.qm
+
+#endif // FMRADIO_RESOURCES_IBY
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rom/qtfmradio_stub.pkg	Fri Jun 04 10:21:36 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: Stub package file for FMRadio
+;
+
+; Languages
+&EN
+
+; Header
+#{"fmradio"}, (0xE6fe9aac), 1, 0, 0, TYPE=SA
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysdef_1_5_1.dtd	Fri Jun 04 10:21:36 2010 +0100
@@ -0,0 +1,88 @@
+ <!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
+  proFile CDATA #IMPLIED
+  qmakeArgs 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>